diff options
author | Jim Meyering <meyering@redhat.com> | 2011-11-29 17:06:11 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-11-29 17:06:50 +0100 |
commit | 5f2a03af5258eabb1263e58229fd4d1f395ca14a (patch) | |
tree | cf89f94c7a33bfbcccadbedb893a9b6f9a861a0d /tests/word-multi-file | |
parent | 8798244b1f23c7df8db079747308c1417254a0ca (diff) | |
download | grep-5f2a03af5258eabb1263e58229fd4d1f395ca14a.tar.gz |
tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name. Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154
Run these commands:
git grep -l -E 'compare [^ ]+ exp' \
|xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/'
git grep -l -E 'compare [^ ]+ /dev/null' \
|xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/'
Diffstat (limited to 'tests/word-multi-file')
-rwxr-xr-x | tests/word-multi-file | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/word-multi-file b/tests/word-multi-file index 6614ab66..1816d606 100755 --- a/tests/word-multi-file +++ b/tests/word-multi-file @@ -21,9 +21,9 @@ sed s/..// exp1 > exp2 || framework_failure_ fail=0 grep -rw bb a > out || fail=1 sort < out > k; mv k out -compare out exp1 || fail=1 +compare exp1 out || fail=1 (cd a && grep -w bb [1-4]) > out || fail=1 -compare out exp2 || fail=1 +compare exp2 out || fail=1 Exit $fail |