diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t0021-conversion.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index a20b9f58e3..cb72fa49de 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -22,7 +22,7 @@ generate_random_characters () { } file_size () { - cat "$1" | wc -c | sed "s/^[ ]*//" + perl -e 'print -s $ARGV[0]' "$1" } filter_git () { @@ -40,10 +40,9 @@ test_cmp_count () { actual=$2 for FILE in "$expect" "$actual" do - sort "$FILE" | uniq -c | sed "s/^[ ]*//" | - sed "s/^\([0-9]\) IN: clean/x IN: clean/" | - sed "s/^\([0-9]\) IN: smudge/x IN: smudge/" >"$FILE.tmp" && - mv "$FILE.tmp" "$FILE" + sort "$FILE" | uniq -c | + sed -e "s/^ *[0-9][0-9]*[ ]*IN: /x IN: /" >"$FILE.tmp" && + mv "$FILE.tmp" "$FILE" || return done && test_cmp "$expect" "$actual" } |