aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/100-cannot_open_files.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/100-cannot_open_files.sh b/tests/100-cannot_open_files.sh
new file mode 100644
index 0000000..4b49acd
--- /dev/null
+++ b/tests/100-cannot_open_files.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+source ./assert.sh
+
+PROGRAM_EXEC="$1"
+
+rm -f input ref out
+touch ref out
+assert_error "cannot open input file" $PROGRAM_EXEC input ref out
+
+rm -f input ref out
+touch input out
+assert_error "cannot open reference file" $PROGRAM_EXEC input ref out
+
+rm -f input ref out
+rmdir outdir 2>/dev/null
+touch input ref
+mkdir outdir
+chmod -w outdir
+assert_error "cannot open output file" $PROGRAM_EXEC input ref outdir/out
+
+rm -f input ref out
+rmdir outdir
+
+exit 0