aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/uniq.tests36
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/uniq.tests b/testsuite/uniq.tests
new file mode 100755
index 000000000..dc37d0a32
--- /dev/null
+++ b/testsuite/uniq.tests
@@ -0,0 +1,36 @@
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
9if [ ${#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
18testing "uniq (default to stdin)" "" "one\ntwo\nthree\n" "" \
19 "one\ntwo\ntwo\nthree\nthree\nthree\n"
20testing "uniq - (specify stdin)" "-" "one\ntwo\nthree\n" "" \
21 "one\ntwo\ntwo\nthree\nthree\nthree\n"
22testing "uniq input (specify file)" "input" "one\ntwo\nthree\n" \
23 "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
24testing "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
29testing "uniq -d" "-d" "two\nthree\n" "" \
30 "one\ntwo\ntwo\nthree\nthree\nthree\n"
31testing "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
36exit $FAILCOUNT