diff options
Diffstat (limited to 'test/pamfile.test')
-rwxr-xr-x | test/pamfile.test | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/test/pamfile.test b/test/pamfile.test index aa3e2895..d605326d 100755 --- a/test/pamfile.test +++ b/test/pamfile.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamfile # Also requires: pamchannel pamtopnm @@ -22,19 +22,13 @@ cat testgrid.pbm testimg.ppm testgrid.pbm | pamfile -machine echo "Test Invalid" -tmpdir=${tmpdir:-/tmp} -test_out=${tmpdir}/test_out +. ${srcdir}/test-invalid.inc -echo 1>&2 -echo "Invalid command-line argument combinations." 1>&2 -echo "Error messages should appear below the line." 1>&2 -echo "-----------------------------------------------------------" 1>&2 +invCmd "pamfile -size -machine testimg.ppm" +invCmd "pamfile -count -machine testimg.ppm" -pamfile -size -machine testimg.ppm > ${test_out} || \ - echo -n "Expected failure 1"; test -s ${test_out}; echo " "$? -pamfile -count -machine testimg.ppm > ${test_out} || \ - echo -n "Expected failure 2"; test -s ${test_out}; echo " "$? -head -n1 testimg.ppm | pamfile > ${test_out} || \ - echo -n "Expected failure 3"; test -s ${test_out}; echo " "$? +head1_ppm=${tmpdir}/head1.ppm -rm ${test_out} +head -n1 testimg.ppm > ${head1_ppm} +invCmd "pamfile ${head1_ppm}" +rm ${head1_ppm} |