diff options
author | Ron Yorston <rmy@pobox.com> | 2020-07-09 13:10:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-07-09 13:10:58 +0100 |
commit | 9c0b2f7020d7c30b21a930ef54be632e092e533b (patch) | |
tree | b2187c40bd2fd9f49f73599fb08e52cb7a596de0 /testsuite | |
parent | a8c6e20e332a9e11a9d28cd6770eadb9c9d73cb7 (diff) | |
parent | d21a63f9fca8eb16f79de9b72d4a3484dfaec1fc (diff) | |
download | busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.gz busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.bz2 busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 8 | ||||
-rwxr-xr-x | testsuite/cpio.tests | 6 | ||||
-rwxr-xr-x | testsuite/mdev.tests | 4 | ||||
-rwxr-xr-x | testsuite/patch.tests | 4 | ||||
-rwxr-xr-x | testsuite/unexpand.tests | 33 |
5 files changed, 48 insertions, 7 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index b5008290f..87f6b5007 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -390,5 +390,13 @@ testing 'awk negative field access' \ | |||
390 | '' \ | 390 | '' \ |
391 | 'anything' | 391 | 'anything' |
392 | 392 | ||
393 | # was misinterpreted as (("str"++) i) instead of ("str" (++i)) | ||
394 | # (and was executed: "str"++ is "0", thus concatenating "0" and "1"): | ||
395 | testing 'awk do not allow "str"++' \ | ||
396 | 'awk -v i=1 "BEGIN {print \"str\" ++i}"' \ | ||
397 | "str2\n" \ | ||
398 | '' \ | ||
399 | 'anything' | ||
400 | |||
393 | 401 | ||
394 | exit $FAILCOUNT | 402 | exit $FAILCOUNT |
diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests index 88ec086b6..85e746589 100755 --- a/testsuite/cpio.tests +++ b/testsuite/cpio.tests | |||
@@ -129,7 +129,7 @@ SKIP= | |||
129 | 129 | ||
130 | optional FEATURE_CPIO_O | 130 | optional FEATURE_CPIO_O |
131 | testing "cpio uses by default uid/gid" \ | 131 | testing "cpio uses by default uid/gid" \ |
132 | "echo $0 | cpio -o -H newc | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \ | 132 | "echo $0 | cpio -o -H newc | cpio -tv 2>&1 | head -n1 | awk ' { print \$2 } '; echo \$?" \ |
133 | "\ | 133 | "\ |
134 | $user/$group | 134 | $user/$group |
135 | 0 | 135 | 0 |
@@ -138,7 +138,7 @@ SKIP= | |||
138 | 138 | ||
139 | optional FEATURE_CPIO_O | 139 | optional FEATURE_CPIO_O |
140 | testing "cpio -R with create" \ | 140 | testing "cpio -R with create" \ |
141 | "echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \ | 141 | "echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | head -n1 | awk ' { print \$2 } '; echo \$?" \ |
142 | "\ | 142 | "\ |
143 | 1234/5678 | 143 | 1234/5678 |
144 | 0 | 144 | 0 |
@@ -147,7 +147,7 @@ SKIP= | |||
147 | 147 | ||
148 | optional FEATURE_CPIO_O | 148 | optional FEATURE_CPIO_O |
149 | testing "cpio -R with extract" \ | 149 | testing "cpio -R with extract" \ |
150 | "echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \ | 150 | "echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | head -n1 | awk ' { print \$2 } '; echo \$?" \ |
151 | "\ | 151 | "\ |
152 | 8765/4321 | 152 | 8765/4321 |
153 | 0 | 153 | 0 |
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests index 8e53ec564..44a723024 100755 --- a/testsuite/mdev.tests +++ b/testsuite/mdev.tests | |||
@@ -93,7 +93,7 @@ SKIP= | |||
93 | # continuing to use directory structure from prev test | 93 | # continuing to use directory structure from prev test |
94 | rm -rf mdev.testdir/dev/* | 94 | rm -rf mdev.testdir/dev/* |
95 | echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf | 95 | echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf |
96 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME | 96 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_LS_SORTFILES |
97 | testing "mdev move/symlink rule '>bar/baz'" \ | 97 | testing "mdev move/symlink rule '>bar/baz'" \ |
98 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; | 98 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; |
99 | ls -lnR mdev.testdir/dev | $FILTER_LS2" \ | 99 | ls -lnR mdev.testdir/dev | $FILTER_LS2" \ |
@@ -111,7 +111,7 @@ SKIP= | |||
111 | # continuing to use directory structure from prev test | 111 | # continuing to use directory structure from prev test |
112 | rm -rf mdev.testdir/dev/* | 112 | rm -rf mdev.testdir/dev/* |
113 | echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf | 113 | echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf |
114 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME | 114 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_LS_SORTFILES |
115 | testing "mdev move/symlink rule '>bar/'" \ | 115 | testing "mdev move/symlink rule '>bar/'" \ |
116 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; | 116 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; |
117 | ls -lnR mdev.testdir/dev | $FILTER_LS2" \ | 117 | ls -lnR mdev.testdir/dev | $FILTER_LS2" \ |
diff --git a/testsuite/patch.tests b/testsuite/patch.tests index 39205242c..1d48e90be 100755 --- a/testsuite/patch.tests +++ b/testsuite/patch.tests | |||
@@ -75,12 +75,12 @@ zxc | |||
75 | testing "patch detects already applied hunk" \ | 75 | testing "patch detects already applied hunk" \ |
76 | 'patch 2>&1; echo $?; cat input' \ | 76 | 'patch 2>&1; echo $?; cat input' \ |
77 | "\ | 77 | "\ |
78 | patching file input | ||
78 | Possibly reversed hunk 1 at 4 | 79 | Possibly reversed hunk 1 at 4 |
79 | Hunk 1 FAILED 1/1. | 80 | Hunk 1 FAILED 1/1. |
80 | abc | 81 | abc |
81 | +def | 82 | +def |
82 | 123 | 83 | 123 |
83 | patching file input | ||
84 | 1 | 84 | 1 |
85 | abc | 85 | abc |
86 | def | 86 | def |
@@ -103,12 +103,12 @@ def | |||
103 | testing "patch detects already applied hunk at the EOF" \ | 103 | testing "patch detects already applied hunk at the EOF" \ |
104 | 'patch 2>&1; echo $?; cat input' \ | 104 | 'patch 2>&1; echo $?; cat input' \ |
105 | "\ | 105 | "\ |
106 | patching file input | ||
106 | Possibly reversed hunk 1 at 4 | 107 | Possibly reversed hunk 1 at 4 |
107 | Hunk 1 FAILED 1/1. | 108 | Hunk 1 FAILED 1/1. |
108 | abc | 109 | abc |
109 | 123 | 110 | 123 |
110 | +456 | 111 | +456 |
111 | patching file input | ||
112 | 1 | 112 | 1 |
113 | abc | 113 | abc |
114 | 123 | 114 | 123 |
diff --git a/testsuite/unexpand.tests b/testsuite/unexpand.tests index 7b326dc2c..aeaae13f0 100755 --- a/testsuite/unexpand.tests +++ b/testsuite/unexpand.tests | |||
@@ -31,6 +31,39 @@ testing "unexpand case 7" "unexpand" \ | |||
31 | testing "unexpand case 8" "unexpand" \ | 31 | testing "unexpand case 8" "unexpand" \ |
32 | "a b\n" "" "a b\n" \ | 32 | "a b\n" "" "a b\n" \ |
33 | 33 | ||
34 | testcase() | ||
35 | { | ||
36 | testing "unexpand flags $*" "unexpand $*" \ | ||
37 | "$want" "" ' a b c' | ||
38 | } | ||
39 | |||
40 | # tabs=8, Convert only leading sequences of blanks | ||
41 | want='\ta b c' | ||
42 | testcase | ||
43 | testcase -f | ||
44 | testcase -f -t8 | ||
45 | testcase -t8 -f | ||
46 | testcase -t8 --first-only | ||
47 | |||
48 | # tabs=8, Convert all blanks | ||
49 | want='\ta\tb c' | ||
50 | testcase -a | ||
51 | testcase -t8 | ||
52 | testcase -a -t8 | ||
53 | |||
54 | # tabs=4, Convert all blanks | ||
55 | want='\t\ta\t\tb\t c' | ||
56 | testcase -t4 | ||
57 | testcase -a -t4 | ||
58 | testcase -t4 -a | ||
59 | |||
60 | # tabs=4, Convert only leading sequences of blanks | ||
61 | want='\t\ta b c' | ||
62 | testcase -t4 -f | ||
63 | testcase -f -t4 | ||
64 | testcase -t4 --first-only | ||
65 | testcase --first-only -t4 | ||
66 | |||
34 | test x"$CONFIG_UNICODE_SUPPORT" = x"y" \ | 67 | test x"$CONFIG_UNICODE_SUPPORT" = x"y" \ |
35 | && test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \ | 68 | && test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \ |
36 | && testing "unexpand with unicode characher 0x394" "unexpand" \ | 69 | && testing "unexpand with unicode characher 0x394" "unexpand" \ |