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:
commit
81cf0b6c7e
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user