summaryrefslogtreecommitdiff
path: root/tests/binary
diff options
context:
space:
mode:
Diffstat (limited to 'tests/binary')
-rwxr-xr-xtests/binary17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/binary b/tests/binary
new file mode 100755
index 0000000..0110f6e
--- /dev/null
+++ b/tests/binary
@@ -0,0 +1,17 @@
+#!/bin/sh
+# small examples
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+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 1, stdout as above, and no stderr.
+test $? = 1 || fail=1
+compare out-exp out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail