diff options
| author | Jim Meyering <meyering@redhat.com> | 2010-02-23 09:39:07 +0100 |
|---|---|---|
| committer | Jim Meyering <meyering@redhat.com> | 2010-02-23 10:29:02 +0100 |
| commit | 1afa8038498155d2666c387547dd2c8c44ca718e (patch) | |
| tree | 0e8dd0cb4c450ebe3951925ebc72b2c6444672f5 /tests/binary | |
| parent | 3f591f4bb5776b4fc91573b940a9d845458cc617 (diff) | |
| download | diffutils-1afa8038498155d2666c387547dd2c8c44ca718e.tar.gz | |
tests: test for the "Binary files A and B differ" diagnostic
* tests/binary: New script.
* tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'tests/binary')
| -rw-r--r-- | tests/binary | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/binary b/tests/binary new file mode 100644 index 0000000..9c31bc6 --- /dev/null +++ b/tests/binary @@ -0,0 +1,19 @@ +#!/bin/sh +# small examples + +test "$VERBOSE" = yes && set -x +: ${srcdir=.} +. "$srcdir/init.sh" + +printf 'Binary files - and /dev/null differ\n' > out-exp || fail_ setup + +fail=0 + +printf '\0'|diff - /dev/null > out 2> err + +# diff must exit with status 2, stdout as above, and no stderr. +test $? = 2 || fail=1 +compare out out-exp || fail=1 +compare err /dev/null || fail=1 + +Exit $fail |
