diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-05 11:24:06 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-05 11:24:06 +0000 |
commit | 32e19e7ae8b0d76d69871ba234e8f0af31baff4e (patch) | |
tree | 6fdc833a444e0dd6fd359b21a8d463856917a387 /testsuite | |
parent | 4fb71406b884c6ac0a9a4d2acf7a32b544611f70 (diff) | |
parent | cad3fc743aa7c7744e4fcf044371f0fda50fa51f (diff) | |
download | busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.gz busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.bz2 busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 5 | ||||
-rwxr-xr-x | testsuite/cat.tests | 24 | ||||
-rwxr-xr-x | testsuite/nl.tests | 39 |
3 files changed, 68 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 92c83d719..cf9b722dc 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -383,6 +383,11 @@ testing "awk errors on missing delete arg" \ | |||
383 | "awk -e '{delete}' 2>&1" "awk: cmd. line:1: Too few arguments\n" "" "" | 383 | "awk -e '{delete}' 2>&1" "awk: cmd. line:1: Too few arguments\n" "" "" |
384 | SKIP= | 384 | SKIP= |
385 | 385 | ||
386 | optional FEATURE_AWK_GNU_EXTENSIONS | ||
387 | testing "awk printf('%c') can output NUL" \ | ||
388 | "awk '{printf(\"hello%c null\n\", 0)}'" "hello\0 null\n" "" "\n" | ||
389 | SKIP= | ||
390 | |||
386 | # testing "description" "command" "result" "infile" "stdin" | 391 | # testing "description" "command" "result" "infile" "stdin" |
387 | testing 'awk negative field access' \ | 392 | testing 'awk negative field access' \ |
388 | 'awk 2>&1 -- '\''{ $(-1) }'\' \ | 393 | 'awk 2>&1 -- '\''{ $(-1) }'\' \ |
diff --git a/testsuite/cat.tests b/testsuite/cat.tests index 10970dc90..cf924ab5b 100755 --- a/testsuite/cat.tests +++ b/testsuite/cat.tests | |||
@@ -22,4 +22,28 @@ testing 'cat -v' \ | |||
22 | 'foo\n' | 22 | 'foo\n' |
23 | SKIP= | 23 | SKIP= |
24 | 24 | ||
25 | optional FEATURE_CATN | ||
26 | testing 'cat -n' \ | ||
27 | 'cat -n' \ | ||
28 | "\ | ||
29 | 1 line 1 | ||
30 | 2 | ||
31 | 3 line 3 | ||
32 | " \ | ||
33 | '' \ | ||
34 | 'line 1\n\nline 3\n' | ||
35 | SKIP= | ||
36 | |||
37 | optional FEATURE_CATN | ||
38 | testing 'cat -b' \ | ||
39 | 'cat -b' \ | ||
40 | "\ | ||
41 | 1 line 1 | ||
42 | |||
43 | 2 line 3 | ||
44 | " \ | ||
45 | '' \ | ||
46 | 'line 1\n\nline 3\n' | ||
47 | SKIP= | ||
48 | |||
25 | exit $FAILCOUNT | 49 | exit $FAILCOUNT |
diff --git a/testsuite/nl.tests b/testsuite/nl.tests new file mode 100755 index 000000000..95e7abb58 --- /dev/null +++ b/testsuite/nl.tests | |||
@@ -0,0 +1,39 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright 2021 by Ron Yorston | ||
3 | # Licensed under GPLv2, see file LICENSE in this source tree. | ||
4 | |||
5 | . ./testing.sh | ||
6 | |||
7 | # testing "test name" "commands" "expected result" "file input" "stdin" | ||
8 | |||
9 | testing "nl numbers all lines" \ | ||
10 | "nl -b a input" \ | ||
11 | "\ | ||
12 | 1 line 1 | ||
13 | 2 | ||
14 | 3 line 3 | ||
15 | " \ | ||
16 | "line 1\n\nline 3\n" \ | ||
17 | "" | ||
18 | |||
19 | testing "nl numbers non-empty lines" \ | ||
20 | "nl -b t input" \ | ||
21 | "\ | ||
22 | 1 line 1 | ||
23 | |||
24 | 2 line 3 | ||
25 | " \ | ||
26 | "line 1\n\nline 3\n" \ | ||
27 | "" | ||
28 | |||
29 | testing "nl numbers no lines" \ | ||
30 | "nl -b n input" \ | ||
31 | "\ | ||
32 | line 1 | ||
33 | |||
34 | line 3 | ||
35 | " \ | ||
36 | "line 1\n\nline 3\n" \ | ||
37 | "" | ||
38 | |||
39 | exit $FAILCOUNT | ||