diff options
author | Elliott Hughes <enh@google.com> | 2017-08-03 17:13:20 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-08-04 03:01:22 -0500 |
commit | 94a898150d5e1fbb89ec46ba56a8600be954a809 (patch) | |
tree | 6a976472496ba67b2933aa7b544ddf7383adcbd6 | |
parent | 105595524ead12dbbc03da683042960b8cbba072 (diff) | |
download | toybox-94a898150d5e1fbb89ec46ba56a8600be954a809.tar.gz |
Don't unnecessarily use printf in wc.test when echo will do.
(And is much faster if your shell doesn't have a builtin printf.)
-rwxr-xr-x | tests/wc.test | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/wc.test b/tests/wc.test index d227b9c0..012bd53b 100755 --- a/tests/wc.test +++ b/tests/wc.test @@ -25,23 +25,23 @@ testing "multiple files" "wc input - file1" \ if printf "%s" "$LANG" | grep -q UTF-8 then -printf " " > file1 -for i in $(seq 1 8192) -do - printf "ü" >> file1 -done -testing "-m" "wc -m file1" "8193 file1\n" "" "" -testing "-m 2" 'cat "$FILES/utf8/test2.txt" | wc -m' "169\n" "" "" -printf " " > file1 -for i in $(seq 1 8192) -do - printf "ü" >> 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" "" + 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 -printf "skipping tests for wc -m" + echo "skipping tests for wc -m" fi rm file1 |