3 # SUSv3 compliant sort tests.
4 # Copyright 2005 by Rob Landley <rob@landley.net>
5 # Licensed under GPL v2, see file LICENSE for details.
7 if [ ${#COMMAND} -eq 0 ]; then COMMAND=sort; fi
10 # The basic tests. These should work even with the small busybox.
12 testing "sort" "input" "a\nb\nc\n" "c\na\nb\n" ""
13 testing "sort #2" "input" "010\n1\n3\n" "3\n1\n010\n" ""
14 testing "sort stdin" "" "a\nb\nc\n" "" "b\na\nc\n"
15 testing "sort numeric" "-n input" "1\n3\n010\n" "3\n1\n010\n" ""
16 testing "sort reverse" "-r input" "wook\nwalrus\npoint\npabst\naargh\n" \
17 "point\nwook\npabst\naargh\nwalrus\n" ""
19 # These tests require the full option set.
21 # Longish chunk of data re-used by the next few tests
32 testing "sort one key" "-k4,4 input" \
40 testing "sort key range with numeric option" "-k2,3n input" \
48 # Busybox is definitely doing this one wrong just now...
50 testing "sort key range with numeric option and global reverse" \
61 testing "sort key range with multiple options" "-k2,3rn input" \