diff options
author | Ron Yorston <rmy@pobox.com> | 2020-02-15 13:25:04 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-02-15 13:25:04 +0000 |
commit | 0abe89bc214c9d1f16f32c4339792066b875b7c6 (patch) | |
tree | 3748f654565bd08513093ebfbb68487f612b5e3f /testsuite | |
parent | 6885083a7e4f94938ca0a98e2c6c69a84eb08a1f (diff) | |
parent | a6e48dead331c3c19e070992d2d571e74a1d9a8d (diff) | |
download | busybox-w32-0abe89bc214c9d1f16f32c4339792066b875b7c6.tar.gz busybox-w32-0abe89bc214c9d1f16f32c4339792066b875b7c6.tar.bz2 busybox-w32-0abe89bc214c9d1f16f32c4339792066b875b7c6.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 23 | ||||
-rwxr-xr-x | testsuite/xargs.tests | 9 |
2 files changed, 31 insertions, 1 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index a7a533ba0..b5008290f 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -85,7 +85,8 @@ testing "awk floating const with leading zeroes" \ | |||
85 | "" "\n" | 85 | "" "\n" |
86 | 86 | ||
87 | # long field seps requiring regex | 87 | # long field seps requiring regex |
88 | testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \ | 88 | testing "awk long field sep" \ |
89 | "awk -F-- '{ print NF, length(\$NF), \$NF }'" \ | ||
89 | "2 0 \n3 0 \n4 0 \n5 0 \n" \ | 90 | "2 0 \n3 0 \n4 0 \n5 0 \n" \ |
90 | "" \ | 91 | "" \ |
91 | "a--\na--b--\na--b--c--\na--b--c--d--" | 92 | "a--\na--b--\na--b--c--\na--b--c--d--" |
@@ -317,6 +318,26 @@ testing "awk length()" \ | |||
317 | "3\n3\n3\n3\n" \ | 318 | "3\n3\n3\n3\n" \ |
318 | "" "qwe" | 319 | "" "qwe" |
319 | 320 | ||
321 | testing "awk print length, 1" \ | ||
322 | "awk '{ print length, 1 }'" \ | ||
323 | "0 1\n" \ | ||
324 | "" "\n" | ||
325 | |||
326 | testing "awk print length 1" \ | ||
327 | "awk '{ print length 1 }'" \ | ||
328 | "01\n" \ | ||
329 | "" "\n" | ||
330 | |||
331 | testing "awk length == 0" \ | ||
332 | "awk 'length == 0 { print \"foo\" }'" \ | ||
333 | "foo\n" \ | ||
334 | "" "\n" | ||
335 | |||
336 | testing "awk if (length == 0)" \ | ||
337 | "awk '{ if (length == 0) { print \"bar\" } }'" \ | ||
338 | "bar\n" \ | ||
339 | "" "\n" | ||
340 | |||
320 | testing "awk -f and ARGC" \ | 341 | testing "awk -f and ARGC" \ |
321 | "awk -f - input" \ | 342 | "awk -f - input" \ |
322 | "re\n2\n" \ | 343 | "re\n2\n" \ |
diff --git a/testsuite/xargs.tests b/testsuite/xargs.tests index 2d0a201b7..855b33bc2 100755 --- a/testsuite/xargs.tests +++ b/testsuite/xargs.tests | |||
@@ -41,4 +41,13 @@ testing "xargs -sNUM test 2" \ | |||
41 | "echo 1 2 3 4 5 6 7 8 9 0\n""echo 1 2 3 4 5 6 7 8 9\n""echo 1 00\n" \ | 41 | "echo 1 2 3 4 5 6 7 8 9 0\n""echo 1 2 3 4 5 6 7 8 9\n""echo 1 00\n" \ |
42 | "" "2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 00\n" | 42 | "" "2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 00\n" |
43 | 43 | ||
44 | # see that we don't get "argument line too long", | ||
45 | # but do see the last word, 99999, instead | ||
46 | optional FEATURE_XARGS_SUPPORT_QUOTES | ||
47 | testing "xargs argument line too long" \ | ||
48 | "seq 10000 99999 | sed -e 's/^/\"/' -e 's/$/\"/' | xargs echo | grep -o 99999; echo \$?" \ | ||
49 | "99999\n0\n" \ | ||
50 | "" "" | ||
51 | SKIP= | ||
52 | |||
44 | exit $FAILCOUNT | 53 | exit $FAILCOUNT |