Mercurial > vim
comparison src/testdir/test_xxd.vim @ 26254:3a13efec0016 v8.2.3658
patch 8.2.3658: duplicate code in xxd
Commit: https://github.com/vim/vim/commit/48608b4a4bfab4b9c0c9199d57b7e876c56db74c
Author: DungSaga <dungsaga@users.noreply.github.com>
Date: Wed Nov 24 11:18:07 2021 +0000
patch 8.2.3658: duplicate code in xxd
Problem: Duplicate code in xxd.
Solution: Merge duplicated code. Add more tests. (closes https://github.com/vim/vim/issues/9192)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 24 Nov 2021 12:30:04 +0100 |
parents | 542cc55a660b |
children | 4061623aa316 |
comparison
equal
deleted
inserted
replaced
26253:c083a69ca5be | 26254:3a13efec0016 |
---|---|
261 call assert_match("Usage:", join(getline(1, 3))) | 261 call assert_match("Usage:", join(getline(1, 3))) |
262 bwipe! | 262 bwipe! |
263 endfor | 263 endfor |
264 endfunc | 264 endfunc |
265 | 265 |
266 func Test_xxd_ignore_garbage() | |
267 new | |
268 exe 'r! printf "\n\r xxxx 0: 42 42" | ' . s:xxd_cmd . ' -r' | |
269 call assert_match('BB', join(getline(1, 3))) | |
270 bwipe! | |
271 endfunc | |
272 | |
273 func Test_xxd_bit_dump() | |
274 new | |
275 exe 'r! printf "123456" | ' . s:xxd_cmd . ' -b1' | |
276 call assert_match('00000000: 00110001 00110010 00110011 00110100 00110101 00110110 123456', join(getline(1, 3))) | |
277 bwipe! | |
278 endfunc | |
279 | |
266 func Test_xxd_version() | 280 func Test_xxd_version() |
267 new | 281 new |
268 exe 'r! ' . s:xxd_cmd . ' -v' | 282 exe 'r! ' . s:xxd_cmd . ' -v' |
269 call assert_match('xxd 20\d\d-\d\d-\d\d by Juergen Weigert et al\.', join(getline(1, 3))) | 283 call assert_match('xxd 20\d\d-\d\d-\d\d by Juergen Weigert et al\.', join(getline(1, 3))) |
270 bwipe! | 284 bwipe! |