aboutsummaryrefslogtreecommitdiff
path: root/tests/100-cannot_open_files.sh
blob: 3ef74a665e37795702edd214b14af9d190c5e65c (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/bash

source ./assert.sh

PROGRAM_EXEC="$1"

rm -f input base out
touch base out
assert "" "cannot open input file" 1 $PROGRAM_EXEC create -i input -b base -o out

rm -f input base out
touch input out
assert "" "cannot open base file" 1 $PROGRAM_EXEC create -i input -b base -o out

rm -f input base out
rmdir outdir 2>/dev/null
touch input base
mkdir outdir
chmod -w outdir
assert "" "cannot open output file" 1 $PROGRAM_EXEC create -i input -b base -o outdir/out

rm -f input base out
rmdir outdir

exit 0