chiark / gitweb /
c10744ed953731325284085bcfc27fbb4c4b4304
[vbig.git] / t-args
1 #! /bin/sh
2 set -e
3 rm -f testoutput testexpect
4
5 echo 'ERROR: invalid size: Numerical result out of range' > testexpect
6 if ./vbig testfile 9223372036854775808 2>testoutput; then
7   echo >&2 ERROR: unexpectedly succeeded
8   exit 1
9 fi
10 diff -u testexpect testoutput
11
12 echo 'ERROR: invalid size' > testexpect
13 if ./vbig testfile 9007199254740992K 2>testoutput; then
14   echo >&2 ERROR: unexpectedly succeeded
15   exit 1
16 fi
17 diff -u testexpect testoutput
18
19 if ./vbig testfile 8796093022208G 2>testoutput; then
20   echo >&2 ERROR: unexpectedly succeeded
21   exit 1
22 fi
23 diff -u testexpect testoutput
24
25 echo 'ERROR: invalid scale' > testexpect
26 if ./vbig testfile 1T 2>testoutput; then
27   echo >&2 ERROR: unexpectedly succeeded
28   exit 1
29 fi
30 diff -u testexpect testoutput
31
32 if ./vbig testfile 1KK 2>testoutput; then
33   echo >&2 ERROR: unexpectedly succeeded
34   exit 1
35 fi
36 diff -u testexpect testoutput
37
38
39 rm -f testoutput testexpect