uniq: support -w. closes bug 3094.
[oweals/busybox.git] / testsuite / uniq.tests
index 49d4bed9c396adcd40976f33d693114c887fc571..8961d669ca7792123a760debea388745ae1a9619 100755 (executable)
@@ -41,6 +41,7 @@ testing "uniq input - (specify stdout)" "uniq input -" \
 #-c occurrences
 #-d dups only
 #-u
+#-w max chars
 
 # Test various command line options
 
@@ -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."