summaryrefslogtreecommitdiff
path: root/tests/binary
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-02-23 09:39:07 +0100
committerJim Meyering <meyering@redhat.com>2010-02-23 10:29:02 +0100
commit1afa8038498155d2666c387547dd2c8c44ca718e (patch)
tree0e8dd0cb4c450ebe3951925ebc72b2c6444672f5 /tests/binary
parent3f591f4bb5776b4fc91573b940a9d845458cc617 (diff)
downloaddiffutils-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/binary19
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