Don't comment warnings. Don't put #warnings about warnings. _FIX_ warnings.
[oweals/busybox.git] / testsuite / uniq.tests
1 #!/bin/sh
2
3 # SUSv3 compliant uniq tests.
4 # Copyright 2005 by Rob Landley <rob@landley.net>
5 # Licensed under GPL v2, see file LICENSE for details.
6
7 # AUDIT: Not full coverage of the spec yet.
8
9 if [ ${#COMMAND} -eq 0 ]; then COMMAND=uniq; fi
10 . testing.sh
11
12 # The basic tests.  These should work even with the small busybox.
13 #-f skip fields
14 #-s skip chars
15 #-c occurrences
16 #-d dups only
17 #-u 
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" ""
28
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"
35
36 exit $FAILCOUNT