aboutsummaryrefslogtreecommitdiff
path: root/tests/100-cannot_open_files.sh
blob: 4b49acdd1709a46e033e44e5296c0e42d78d2989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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