Merge branch 'ls/filter-process'

Test portability improvements and optimization for an
already-graduated topic.

* ls/filter-process:
  t0021: compute file size with a single process instead of a pipeline
  t0021: expect more variations in the output of uniq -c
This commit is contained in:
Junio C Hamano 2016-11-10 13:17:30 -08:00
commit 81cf0b6c7e

View File

@ -22,7 +22,7 @@ generate_random_characters () {
} }
file_size () { file_size () {
cat "$1" | wc -c | sed "s/^[ ]*//" perl -e 'print -s $ARGV[0]' "$1"
} }
filter_git () { filter_git () {
@ -40,10 +40,9 @@ test_cmp_count () {
actual=$2 actual=$2
for FILE in "$expect" "$actual" for FILE in "$expect" "$actual"
do do
sort "$FILE" | uniq -c | sed "s/^[ ]*//" | sort "$FILE" | uniq -c |
sed "s/^\([0-9]\) IN: clean/x IN: clean/" | sed -e "s/^ *[0-9][0-9]*[ ]*IN: /x IN: /" >"$FILE.tmp" &&
sed "s/^\([0-9]\) IN: smudge/x IN: smudge/" >"$FILE.tmp" && mv "$FILE.tmp" "$FILE" || return
mv "$FILE.tmp" "$FILE"
done && done &&
test_cmp "$expect" "$actual" test_cmp "$expect" "$actual"
} }