diff options
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/head.tests | 41 | ||||
-rw-r--r-- | testsuite/head/head-n-works | 4 | ||||
-rw-r--r-- | testsuite/head/head-works | 4 |
3 files changed, 41 insertions, 8 deletions
diff --git a/testsuite/head.tests b/testsuite/head.tests new file mode 100755 index 000000000..50660d267 --- /dev/null +++ b/testsuite/head.tests | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright 2018 Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> | ||
3 | # Licensed under GPLv2 or later, see file LICENSE in this source tree. | ||
4 | |||
5 | . ./testing.sh | ||
6 | |||
7 | # testing "test name" "command" "expected result" "file input" "stdin" | ||
8 | |||
9 | cat <<EOF > head.input | ||
10 | line 1 | ||
11 | line 2 | ||
12 | line 3 | ||
13 | line 4 | ||
14 | line 5 | ||
15 | line 6 | ||
16 | line 7 | ||
17 | line 8 | ||
18 | line 9 | ||
19 | line 10 | ||
20 | line 11 | ||
21 | line 12 | ||
22 | EOF | ||
23 | |||
24 | testing "head (without args)" \ | ||
25 | "head head.input" \ | ||
26 | "line 1\nline 2\nline 3\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\nline 10\n" \ | ||
27 | "" "" | ||
28 | |||
29 | testing "head -n <positive number>" \ | ||
30 | "head -n 2 head.input" \ | ||
31 | "line 1\nline 2\n" \ | ||
32 | "" "" | ||
33 | |||
34 | testing "head -n <negative number>" \ | ||
35 | "head -n -9 head.input" \ | ||
36 | "line 1\nline 2\nline 3\n" \ | ||
37 | "" "" | ||
38 | |||
39 | rm head.input | ||
40 | |||
41 | exit $FAILCOUNT | ||
diff --git a/testsuite/head/head-n-works b/testsuite/head/head-n-works deleted file mode 100644 index db4325556..000000000 --- a/testsuite/head/head-n-works +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | [ -n "$d" ] || d=.. | ||
2 | head -n 2 "$d/README" > logfile.gnu | ||
3 | busybox head -n 2 "$d/README" > logfile.bb | ||
4 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/head/head-works b/testsuite/head/head-works deleted file mode 100644 index 56ad3e36b..000000000 --- a/testsuite/head/head-works +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | [ -n "$d" ] || d=.. | ||
2 | head "$d/README" > logfile.gnu | ||
3 | busybox head "$d/README" > logfile.bb | ||
4 | cmp logfile.gnu logfile.bb | ||