aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-09-06 06:12:09 -0500
committerRob Landley <rob@landley.net>2017-09-06 06:12:09 -0500
commit5f6850fa5eccca80cd446593a21edc462a1dfad1 (patch)
treecab75e93589d751c0638a716fa9b810d733dc189 /tests
parentb9613842c3ac1a874b56dff4d1f8ce80c2dbab9d (diff)
downloadtoybox-5f6850fa5eccca80cd446593a21edc462a1dfad1.tar.gz
Tighten up wc -m tests (which no longer depend on $LANG).
Diffstat (limited to 'tests')
-rwxr-xr-xtests/wc.test28
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/wc.test b/tests/wc.test
index 012bd53b..f4431729 100755
--- a/tests/wc.test
+++ b/tests/wc.test
@@ -22,26 +22,10 @@ testing "multiple files" "wc input - file1" \
" 1 2 3 input\n 0 2 3 -\n 4 5 26 file1\n 5 9 32 total\n" "a\nb" "a b"
#Tests for wc -m
-if printf "%s" "$LANG" | grep -q UTF-8
-then
-
- echo -n " " > file1
- for i in $(seq 1 8192)
- do
- echo -n "ü" >> file1
- done
- testing "-m" "wc -m file1" "8193 file1\n" "" ""
- testing "-m 2" 'cat "$FILES/utf8/test2.txt" | wc -m' "169\n" "" ""
- echo -n " " > file1
- for i in $(seq 1 8192)
- do
- echo -n "ü" >> file1
- done
- testing "-m (invalid chars)" "wc -m file1" "8193 file1\n" "" ""
- NOSPACE=1 testing "-mlw" "wc -mlw input" " 1 2 11 input\n" "hello, 世界!\n" ""
-
-else
- echo "skipping tests for wc -m"
-fi
-
+echo -n " " > file1
+for i in $(seq 1 512); do echo -n "üüüüüüüüüüüüüüüü" >> file1; done
+testing "-m" "wc -m file1" "8193 file1\n" "" ""
+testing "-m 2" 'cat "$FILES/utf8/test2.txt" | wc -m' "169\n" "" ""
+echo -n " " > file1
+NOSPACE=1 testing "-mlw" "wc -mlw input" " 1 2 11 input\n" "hello, 世界!\n" ""
rm file1