aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
committerRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
commit32e19e7ae8b0d76d69871ba234e8f0af31baff4e (patch)
tree6fdc833a444e0dd6fd359b21a8d463856917a387 /testsuite
parent4fb71406b884c6ac0a9a4d2acf7a32b544611f70 (diff)
parentcad3fc743aa7c7744e4fcf044371f0fda50fa51f (diff)
downloadbusybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.gz
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.bz2
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/awk.tests5
-rwxr-xr-xtestsuite/cat.tests24
-rwxr-xr-xtestsuite/nl.tests39
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" "" ""
384SKIP= 384SKIP=
385 385
386optional FEATURE_AWK_GNU_EXTENSIONS
387testing "awk printf('%c') can output NUL" \
388 "awk '{printf(\"hello%c null\n\", 0)}'" "hello\0 null\n" "" "\n"
389SKIP=
390
386# testing "description" "command" "result" "infile" "stdin" 391# testing "description" "command" "result" "infile" "stdin"
387testing 'awk negative field access' \ 392testing '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'
23SKIP= 23SKIP=
24 24
25optional FEATURE_CATN
26testing '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'
35SKIP=
36
37optional FEATURE_CATN
38testing 'cat -b' \
39 'cat -b' \
40"\
41 1 line 1
42
43 2 line 3
44" \
45 '' \
46 'line 1\n\nline 3\n'
47SKIP=
48
25exit $FAILCOUNT 49exit $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
9testing "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
19testing "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
29testing "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
39exit $FAILCOUNT