aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
committerRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
commit9c0b2f7020d7c30b21a930ef54be632e092e533b (patch)
treeb2187c40bd2fd9f49f73599fb08e52cb7a596de0 /testsuite
parenta8c6e20e332a9e11a9d28cd6770eadb9c9d73cb7 (diff)
parentd21a63f9fca8eb16f79de9b72d4a3484dfaec1fc (diff)
downloadbusybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.gz
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.bz2
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/awk.tests8
-rwxr-xr-xtestsuite/cpio.tests6
-rwxr-xr-xtestsuite/mdev.tests4
-rwxr-xr-xtestsuite/patch.tests4
-rwxr-xr-xtestsuite/unexpand.tests33
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"):
395testing 'awk do not allow "str"++' \
396 'awk -v i=1 "BEGIN {print \"str\" ++i}"' \
397 "str2\n" \
398 '' \
399 'anything'
400
393 401
394exit $FAILCOUNT 402exit $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
130optional FEATURE_CPIO_O 130optional FEATURE_CPIO_O
131testing "cpio uses by default uid/gid" \ 131testing "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
1350 1350
@@ -138,7 +138,7 @@ SKIP=
138 138
139optional FEATURE_CPIO_O 139optional FEATURE_CPIO_O
140testing "cpio -R with create" \ 140testing "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"\
1431234/5678 1431234/5678
1440 1440
@@ -147,7 +147,7 @@ SKIP=
147 147
148optional FEATURE_CPIO_O 148optional FEATURE_CPIO_O
149testing "cpio -R with extract" \ 149testing "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"\
1528765/4321 1528765/4321
1530 1530
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
94rm -rf mdev.testdir/dev/* 94rm -rf mdev.testdir/dev/*
95echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf 95echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf
96optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME 96optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_LS_SORTFILES
97testing "mdev move/symlink rule '>bar/baz'" \ 97testing "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
112rm -rf mdev.testdir/dev/* 112rm -rf mdev.testdir/dev/*
113echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf 113echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf
114optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME 114optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_LS_SORTFILES
115testing "mdev move/symlink rule '>bar/'" \ 115testing "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
75testing "patch detects already applied hunk" \ 75testing "patch detects already applied hunk" \
76 'patch 2>&1; echo $?; cat input' \ 76 'patch 2>&1; echo $?; cat input' \
77"\ 77"\
78patching file input
78Possibly reversed hunk 1 at 4 79Possibly reversed hunk 1 at 4
79Hunk 1 FAILED 1/1. 80Hunk 1 FAILED 1/1.
80 abc 81 abc
81+def 82+def
82 123 83 123
83patching file input
841 841
85abc 85abc
86def 86def
@@ -103,12 +103,12 @@ def
103testing "patch detects already applied hunk at the EOF" \ 103testing "patch detects already applied hunk at the EOF" \
104 'patch 2>&1; echo $?; cat input' \ 104 'patch 2>&1; echo $?; cat input' \
105"\ 105"\
106patching file input
106Possibly reversed hunk 1 at 4 107Possibly reversed hunk 1 at 4
107Hunk 1 FAILED 1/1. 108Hunk 1 FAILED 1/1.
108 abc 109 abc
109 123 110 123
110+456 111+456
111patching file input
1121 1121
113abc 113abc
114123 114123
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" \
31testing "unexpand case 8" "unexpand" \ 31testing "unexpand case 8" "unexpand" \
32 "a b\n" "" "a b\n" \ 32 "a b\n" "" "a b\n" \
33 33
34testcase()
35{
36 testing "unexpand flags $*" "unexpand $*" \
37 "$want" "" ' a b c'
38}
39
40# tabs=8, Convert only leading sequences of blanks
41want='\ta b c'
42testcase
43testcase -f
44testcase -f -t8
45testcase -t8 -f
46testcase -t8 --first-only
47
48# tabs=8, Convert all blanks
49want='\ta\tb c'
50testcase -a
51testcase -t8
52testcase -a -t8
53
54# tabs=4, Convert all blanks
55want='\t\ta\t\tb\t c'
56testcase -t4
57testcase -a -t4
58testcase -t4 -a
59
60# tabs=4, Convert only leading sequences of blanks
61want='\t\ta b c'
62testcase -t4 -f
63testcase -f -t4
64testcase -t4 --first-only
65testcase --first-only -t4
66
34test x"$CONFIG_UNICODE_SUPPORT" = x"y" \ 67test 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" \