patch 9.0.1383: xxd: combination of little endian and cols fails
Problem: xxd: combination of little endian and cols fails. (Aapo
Rantalainen)
Solution: Round up the space taken by the hex output. (closes #12097)
diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim
index 92a4d05..d20ea9c 100644
--- a/src/testdir/test_xxd.vim
+++ b/src/testdir/test_xxd.vim
@@ -401,4 +401,18 @@
endfor
endfunc
+func Test_xxd_little_endian_with_cols()
+ enew!
+ call writefile(["ABCDEF"], 'Xxdin', 'D')
+ exe 'r! ' .. s:xxd_cmd .. ' -e -c6 ' .. ' Xxdin'
+ call assert_equal('00000000: 44434241 4645 ABCDEF', getline(2))
+
+ enew!
+ call writefile(["ABCDEFGHI"], 'Xxdin', 'D')
+ exe 'r! ' .. s:xxd_cmd .. ' -e -c9 ' .. ' Xxdin'
+ call assert_equal('00000000: 44434241 48474645 49 ABCDEFGHI', getline(2))
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab