blob: 4e7c45f44cfef078dc71d30781150c56caad7171 (
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 ref out
touch ref out
assert "" "cannot get size of input file" 1 $PROGRAM_EXEC backup input ref out
rm -f input ref out
touch input out
assert "" "cannot get size of reference file" 1 $PROGRAM_EXEC backup input ref out
rm -f input ref out
rmdir outdir 2>/dev/null
touch input ref
mkdir outdir
chmod -w outdir
assert "" "cannot open output file" 1 $PROGRAM_EXEC backup input ref outdir/out
rm -f input ref out
rmdir outdir
exit 0
|