httpd: fix handling of range requests
[oweals/busybox.git] / testsuite / uniq.tests
index a1b69c2e5b60f51ec1a051f85d20d9fe3d10560b..83bf382cd2291f6924f3d542c9462db26371778d 100755 (executable)
@@ -2,11 +2,11 @@
 
 # SUSv3 compliant uniq tests.
 # Copyright 2005 by Rob Landley <rob@landley.net>
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
 
 # AUDIT: Full SUSv3 coverage (except internationalization).
 
-. testing.sh
+. ./testing.sh
 
 # testing "test name" "options" "expected result" "file input" "stdin"
 #   file input will be file called "input"
@@ -40,7 +40,8 @@ testing "uniq input - (specify stdout)" "uniq input -" \
 #-s skip chars
 #-c occurrences
 #-d dups only
-#-u 
+#-u
+#-w max chars
 
 # Test various command line options
 
@@ -49,7 +50,7 @@ testing "uniq input - (specify stdout)" "uniq input -" \
 testing "uniq -c (occurrence count)" "uniq -c | sed 's/^[ \t]*//'" \
        "1 one\n2 two\n3 three\n" "" \
        "one\ntwo\ntwo\nthree\nthree\nthree\n"
-testing "uniq -d (dups only) " "uniq -d" "two\nthree\n" "" \
+testing "uniq -d (dups only)" "uniq -d" "two\nthree\n" "" \
        "one\ntwo\ntwo\nthree\nthree\nthree\n"
 
 testing "uniq -f -s (skip fields and chars)" "uniq -f2 -s 3" \
@@ -60,6 +61,22 @@ aa   bb      cc9
 bb     cc      dd8
 aa     bb      cc9
 "
+testing "uniq -w (compare max characters)" "uniq -w 2" \
+"cc1
+" "" \
+"cc1
+cc2
+cc3
+"
+
+testing "uniq -s -w (skip fields and compare max chars)" \
+"uniq -s 2 -w 2" \
+"aaccaa
+" "" \
+"aaccaa
+aaccbb
+bbccaa
+"
 
 # -d is "Suppress the writing fo lines that are not repeated in the input."
 # -u is "Suppress the writing of lines that are repeated in the input."