diff options
author | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
commit | ead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch) | |
tree | af268270382dad969218063d4a8120fc91a9e631 /testsuite | |
parent | 567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff) | |
parent | 64981b4c8e88812c322bee3832f1d421ff670ed5 (diff) | |
download | busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2 busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/hexdump.tests | 19 | ||||
-rwxr-xr-x | testsuite/xargs.tests | 8 | ||||
-rwxr-xr-x | testsuite/xxd.tests | 34 |
3 files changed, 61 insertions, 0 deletions
diff --git a/testsuite/hexdump.tests b/testsuite/hexdump.tests index 45a0c1300..cfb20187e 100755 --- a/testsuite/hexdump.tests +++ b/testsuite/hexdump.tests | |||
@@ -15,4 +15,23 @@ testing 'hexdump -C with four NULs' \ | |||
15 | '' \ | 15 | '' \ |
16 | '\0\0\0\0' | 16 | '\0\0\0\0' |
17 | 17 | ||
18 | testing "hexdump does not think last padded block matches any full block" \ | ||
19 | "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \ | ||
20 | "\ | ||
21 | 00|00! | ||
22 | * | ||
23 | 00| ! | ||
24 | " \ | ||
25 | '' \ | ||
26 | '\0\0\0\0\0\0\0\0\0\0\0' | ||
27 | |||
28 | testing "hexdump thinks last full block can match" \ | ||
29 | "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \ | ||
30 | "\ | ||
31 | 00|00! | ||
32 | * | ||
33 | " \ | ||
34 | '' \ | ||
35 | '\0\0\0\0\0\0\0\0\0\0\0\0' | ||
36 | |||
18 | exit $FAILCOUNT | 37 | exit $FAILCOUNT |
diff --git a/testsuite/xargs.tests b/testsuite/xargs.tests index 159f1ff69..e7c7c4b3d 100755 --- a/testsuite/xargs.tests +++ b/testsuite/xargs.tests | |||
@@ -61,4 +61,12 @@ testing "xargs -n2" \ | |||
61 | 61 | ||
62 | SKIP= | 62 | SKIP= |
63 | 63 | ||
64 | optional FEATURE_XARGS_SUPPORT_QUOTES | ||
65 | testing "xargs -I skips empty lines and leading whitespace" \ | ||
66 | "xargs -I% echo '[%]'" \ | ||
67 | "[2]\n[4]\n[6 6 ]\n[7]\n" \ | ||
68 | "" " \n2\n\n4\n\n 6 6 \n \v \t 7\n\t\n\v\n" | ||
69 | |||
70 | SKIP= | ||
71 | |||
64 | exit $FAILCOUNT | 72 | exit $FAILCOUNT |
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 | ||