3 # SUSv3 compliant uniq tests.
4 # Copyright 2005 by Rob Landley <rob@landley.net>
5 # Licensed under GPL v2, see file LICENSE for details.
7 # AUDIT: Not full coverage of the spec yet.
9 if [ ${#COMMAND} -eq 0 ]; then COMMAND=uniq; fi
12 # The basic tests. These should work even with the small busybox.
18 testing "uniq (default to stdin)" "" "one\ntwo\nthree\n" "" \
19 "one\ntwo\ntwo\nthree\nthree\nthree\n"
20 testing "uniq - (specify stdin)" "-" "one\ntwo\nthree\n" "" \
21 "one\ntwo\ntwo\nthree\nthree\nthree\n"
22 testing "uniq input (specify file)" "input" "one\ntwo\nthree\n" \
23 "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
24 testing "uniq input outfile (two files)" "input actual > /dev/null" \
25 "one\ntwo\nthree\n" "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
26 #testing "uniq - outfile" "- outfile" "one\ntwo\nthree\n" \
27 # "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
29 testing "uniq -d" "-d" "two\nthree\n" "" \
30 "one\ntwo\ntwo\nthree\nthree\nthree\n"
31 testing "uniq -c" "-c" " 1 one\n 2 two\n 3 three\n" "" \
32 "one\ntwo\ntwo\nthree\nthree\nthree\n"
33 # testing "uniq -c -d"
34 # testing "uniq infile"