diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-10-20 18:54:36 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-10-20 18:57:02 +0200 |
commit | dac5b8314236338963877903cba3d7edfbfc9c58 (patch) | |
tree | 5e7ce92407b9079b4e49e728f28f8a7c6311999c /testsuite | |
parent | 085f19cdffd653013b1483c08851ecc35cdd818e (diff) | |
download | busybox-w32-dac5b8314236338963877903cba3d7edfbfc9c58.tar.gz busybox-w32-dac5b8314236338963877903cba3d7edfbfc9c58.tar.bz2 busybox-w32-dac5b8314236338963877903cba3d7edfbfc9c58.zip |
xxd: fix printing of trailing spaces
function old new delta
bb_dump_dump 1497 1523 +26
xxd_main 459 466 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/xxd.tests | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/xxd.tests b/testsuite/xxd.tests new file mode 100755 index 000000000..2e80be5fe --- /dev/null +++ b/testsuite/xxd.tests | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Copyright 2020 by Denys Vlasenko <vda.linux@googlemail.com> | ||
4 | # Licensed under GPLv2, see file LICENSE in this source tree. | ||
5 | |||
6 | . ./testing.sh | ||
7 | |||
8 | # testing "description" "command" "result" "infile" "stdin" | ||
9 | testing 'xxd -p with one NUL' \ | ||
10 | 'xxd -p' \ | ||
11 | "\ | ||
12 | 00 | ||
13 | " \ | ||
14 | '' \ | ||
15 | '\0' | ||
16 | |||
17 | testing 'xxd -p with 30 NULs' \ | ||
18 | 'xxd -p' \ | ||
19 | "\ | ||
20 | 000000000000000000000000000000000000000000000000000000000000 | ||
21 | " \ | ||
22 | '' \ | ||
23 | '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' | ||
24 | |||
25 | testing 'xxd -p with 31 NULs' \ | ||
26 | 'xxd -p' \ | ||
27 | "\ | ||
28 | 000000000000000000000000000000000000000000000000000000000000 | ||
29 | 00 | ||
30 | " \ | ||
31 | '' \ | ||
32 | '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' | ||
33 | |||
34 | exit $FAILCOUNT | ||