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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/sh
echo $0 TESTS BEGIN
#these tests should all return zero (parse succeeded)
./test_file --help || exit 1
./test_file foo.bar foo.bar foo.bar .bar || exit 1
./test_file /foo.bar /foo.bar foo.bar .bar || exit 1
./test_file ./foo.bar ./foo.bar foo.bar .bar || exit 1
./test_file ././foo.bar ././foo.bar foo.bar .bar || exit 1
./test_file ./././foo.bar ./././foo.bar foo.bar .bar || exit 1
./test_file ../foo.bar ../foo.bar foo.bar .bar || exit 1
./test_file ../../foo.bar ../../foo.bar foo.bar .bar || exit 1
./test_file foo foo foo '' || exit 1
./test_file /foo /foo foo '' || exit 1
./test_file ./foo ./foo foo '' || exit 1
./test_file ././foo ././foo foo '' || exit 1
./test_file ./././foo ./././foo foo '' || exit 1
./test_file ../foo ../foo foo '' || exit 1
./test_file ../../foo ../../foo foo '' || exit 1
./test_file .foo .foo .foo '' || exit 1
./test_file /.foo /.foo .foo '' || exit 1
./test_file ./.foo ./.foo .foo '' || exit 1
./test_file ../.foo ../.foo .foo '' || exit 1
./test_file foo. foo. foo. '' || exit 1
./test_file /foo. /foo. foo. '' || exit 1
./test_file ./foo. ./foo. foo. '' || exit 1
./test_file ../foo. ../foo. foo. '' || exit 1
./test_file /.foo. /.foo. .foo. '' || exit 1
./test_file /.foo.c /.foo.c .foo.c .c || exit 1
./test_file /.foo..b.c /.foo..b.c .foo..b.c .c || exit 1
./test_file / / '' '' || exit 1
./test_file . . '' '' || exit 1
./test_file .. .. '' '' || exit 1
./test_file /. /. '' '' || exit 1
./test_file /.. /.. '' '' || exit 1
./test_file ./ ./ '' '' || exit 1
./test_file ../ ../ '' '' || exit 1
#these tests should all return non-zero (parse failed)
./test_file && exit 1
echo "$0 TESTS PASSED"
echo "----------------------------------"
|