aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
committerRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
commitead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch)
treeaf268270382dad969218063d4a8120fc91a9e631 /testsuite
parent567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff)
parent64981b4c8e88812c322bee3832f1d421ff670ed5 (diff)
downloadbusybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/hexdump.tests19
-rwxr-xr-xtestsuite/xargs.tests8
-rwxr-xr-xtestsuite/xxd.tests34
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
18testing "hexdump does not think last padded block matches any full block" \
19 "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
20 "\
2100|00!
22*
2300| !
24" \
25 '' \
26 '\0\0\0\0\0\0\0\0\0\0\0'
27
28testing "hexdump thinks last full block can match" \
29 "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
30 "\
3100|00!
32*
33" \
34 '' \
35 '\0\0\0\0\0\0\0\0\0\0\0\0'
36
18exit $FAILCOUNT 37exit $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
62SKIP= 62SKIP=
63 63
64optional FEATURE_XARGS_SUPPORT_QUOTES
65testing "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
70SKIP=
71
64exit $FAILCOUNT 72exit $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"
9testing 'xxd -p with one NUL' \
10 'xxd -p' \
11 "\
1200
13" \
14 '' \
15 '\0'
16
17testing 'xxd -p with 30 NULs' \
18 'xxd -p' \
19 "\
20000000000000000000000000000000000000000000000000000000000000
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
25testing 'xxd -p with 31 NULs' \
26 'xxd -p' \
27 "\
28000000000000000000000000000000000000000000000000000000000000
2900
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
34exit $FAILCOUNT