summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-03 07:21:27 +0000
committerDenis Vlasenko2008-05-03 07:21:27 +0000
commit96b99b860cc15f13b85b1b2d5b5b20ab7183a652 (patch)
treef7f5236085dcc40f02bd29078900d971a787344e /testsuite
parent687a26fe0dcf10f227cb0541882d1daa8a21991d (diff)
downloadbusybox-96b99b860cc15f13b85b1b2d5b5b20ab7183a652.zip
busybox-96b99b860cc15f13b85b1b2d5b5b20ab7183a652.tar.gz
uniq: support -w. closes bug 3094.
function old new delta packed_usage 24136 24132 -4 uniq_main 399 384 -15
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/uniq.tests17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/uniq.tests b/testsuite/uniq.tests
index 49d4bed..8961d66 100755
--- a/testsuite/uniq.tests
+++ b/testsuite/uniq.tests
@@ -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."