diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-26 14:11:19 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-26 14:11:19 +0100 |
commit | 203651b9b2e2f478c9a2be25f86ce9712a21a796 (patch) | |
tree | 0d8d0b722f826f3c6c783a69cd59d72d95984bf0 /src/testdir/test_xxd.vim | |
parent | cb574f415486adff645ce384979bfecf27f5be8c (diff) |
patch 8.1.0823: not sufficient testing of xxdv8.1.0823
Problem: Not sufficient testing of xxd.
Solution: Add some more test coverage.
Diffstat (limited to 'src/testdir/test_xxd.vim')
-rw-r--r-- | src/testdir/test_xxd.vim | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim index b1a7b0888f..7762667119 100644 --- a/src/testdir/test_xxd.vim +++ b/src/testdir/test_xxd.vim @@ -75,7 +75,7 @@ func Test_xxd() let s:test += 1 for arg in ['-l 13', '-l13', '-len 13'] %d - exe '0r! ' . s:xxd_cmd . ' -s 0x36 -l 13 -cols 13 ' . fname + exe '0r! ' . s:xxd_cmd . ' -s 0x36 ' . arg . ' -cols 13 ' . fname $d call assert_equal('00000036: 3231 7374 204d 6179 2031 3939 36 21st May 1996', getline(1), s:Mess(s:test)) endfor @@ -131,6 +131,24 @@ func Test_xxd() call delete('XXDfile') endfor + " Test 11: reverse with CR, hex upper, Postscript style with a TAB + let s:test += 1 + call writefile([" 54455354\t610B6364 30390A TESTa\0x0bcd09.\r"], 'Xinput') + silent exe '!' . s:xxd_cmd . ' -r -p < Xinput > XXDfile' + let blob = readfile('XXDfile', 'B') + call assert_equal(0z54455354.610B6364.30390A, blob) + call delete('Xinput') + call delete('XXDfile') + + " Test 12: reverse with seek + let s:test += 1 + call writefile(["00000000: 54455354\t610B6364 30390A TESTa\0x0bcd09.\r"], 'Xinput') + silent exe '!' . s:xxd_cmd . ' -r -seek 5 < Xinput > XXDfile' + let blob = readfile('XXDfile', 'B') + call assert_equal(0z0000000000.54455354.610B6364.30390A, blob) + call delete('Xinput') + call delete('XXDfile') + " TODO: " -o -offset |