diff options
Diffstat (limited to 'testsuite/sort.tests')
-rwxr-xr-x | testsuite/sort.tests | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/testsuite/sort.tests b/testsuite/sort.tests index 294530988..d1b42532d 100755 --- a/testsuite/sort.tests +++ b/testsuite/sort.tests | |||
@@ -4,16 +4,15 @@ | |||
4 | # Copyright 2005 by Rob Landley <rob@landley.net> | 4 | # Copyright 2005 by Rob Landley <rob@landley.net> |
5 | # Licensed under GPL v2, see file LICENSE for details. | 5 | # Licensed under GPL v2, see file LICENSE for details. |
6 | 6 | ||
7 | if [ ${#COMMAND} -eq 0 ]; then COMMAND=sort; fi | ||
8 | . testing.sh | 7 | . testing.sh |
9 | 8 | ||
10 | # The basic tests. These should work even with the small busybox. | 9 | # The basic tests. These should work even with the small busybox. |
11 | 10 | ||
12 | testing "sort" "input" "a\nb\nc\n" "c\na\nb\n" "" | 11 | testing "sort" "sort input" "a\nb\nc\n" "c\na\nb\n" "" |
13 | testing "sort #2" "input" "010\n1\n3\n" "3\n1\n010\n" "" | 12 | testing "sort #2" "sort input" "010\n1\n3\n" "3\n1\n010\n" "" |
14 | testing "sort stdin" "" "a\nb\nc\n" "" "b\na\nc\n" | 13 | testing "sort stdin" "sort" "a\nb\nc\n" "" "b\na\nc\n" |
15 | testing "sort numeric" "-n input" "1\n3\n010\n" "3\n1\n010\n" "" | 14 | testing "sort numeric" "sort -n input" "1\n3\n010\n" "3\n1\n010\n" "" |
16 | testing "sort reverse" "-r input" "wook\nwalrus\npoint\npabst\naargh\n" \ | 15 | testing "sort reverse" "sort -r input" "wook\nwalrus\npoint\npabst\naargh\n" \ |
17 | "point\nwook\npabst\naargh\nwalrus\n" "" | 16 | "point\nwook\npabst\naargh\nwalrus\n" "" |
18 | 17 | ||
19 | # These tests require the full option set. | 18 | # These tests require the full option set. |
@@ -30,7 +29,7 @@ egg 1 2 papyrus | |||
30 | 29 | ||
31 | # Sorting with keys | 30 | # Sorting with keys |
32 | 31 | ||
33 | testing "sort one key" "-k4,4 input" \ | 32 | testing "sort one key" "sort -k4,4 input" \ |
34 | "999 3 0 algebra | 33 | "999 3 0 algebra |
35 | egg 1 2 papyrus | 34 | egg 1 2 papyrus |
36 | 7 3 42 soup | 35 | 7 3 42 soup |
@@ -38,7 +37,7 @@ egg 1 2 papyrus | |||
38 | 42 1 010 zoology | 37 | 42 1 010 zoology |
39 | " "$data" "" | 38 | " "$data" "" |
40 | 39 | ||
41 | testing "sort key range with numeric option" "-k2,3n input" \ | 40 | testing "sort key range with numeric option" "sort -k2,3n input" \ |
42 | "42 1 010 zoology | 41 | "42 1 010 zoology |
43 | 42 1 3 woot | 42 | 42 1 3 woot |
44 | egg 1 2 papyrus | 43 | egg 1 2 papyrus |
@@ -49,7 +48,7 @@ egg 1 2 papyrus | |||
49 | # Busybox is definitely doing this one wrong just now. FIXME | 48 | # Busybox is definitely doing this one wrong just now. FIXME |
50 | 49 | ||
51 | testing "sort key range with numeric option and global reverse" \ | 50 | testing "sort key range with numeric option and global reverse" \ |
52 | "-k2,3n -r input" \ | 51 | "sort -k2,3n -r input" \ |
53 | "egg 1 2 papyrus | 52 | "egg 1 2 papyrus |
54 | 42 1 3 woot | 53 | 42 1 3 woot |
55 | 42 1 010 zoology | 54 | 42 1 010 zoology |
@@ -59,7 +58,7 @@ testing "sort key range with numeric option and global reverse" \ | |||
59 | 58 | ||
60 | # | 59 | # |
61 | 60 | ||
62 | testing "sort key range with multiple options" "-k2,3rn input" \ | 61 | testing "sort key range with multiple options" "sort -k2,3rn input" \ |
63 | "7 3 42 soup | 62 | "7 3 42 soup |
64 | 999 3 0 algebra | 63 | 999 3 0 algebra |
65 | 42 1 010 zoology | 64 | 42 1 010 zoology |