t0021: expect more variations in the output of uniq -c
Some versions of uniq -c write the count left-justified, other version write it right-justified. Be prepared for both kinds. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jeff King <peff@peff.net>maint
parent
0f71fa273f
commit
038212c4c4
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue