From 54a249d24811a5841b853f9a88a0c5c9871133e3 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 18 Oct 2017 03:40:11 +0000 Subject: Make test work with 'wc' that puts white space at the beginning of the line git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3085 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/pamtopdbimg.test | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/pamtopdbimg.test b/test/pamtopdbimg.test index 267f6bc8..8de78a70 100755 --- a/test/pamtopdbimg.test +++ b/test/pamtopdbimg.test @@ -48,14 +48,20 @@ rm ${noise_pgm} # 0 # 1 # 0 + +# Some versions of wc have extra whitespace in the output (e.g. MAC OS) +# Delete with tr -d + echo long titles for flag in "" "-title=0123456789012345678901234567890" \ "-title=01234567890123456789012345678901" do - pamtopdbimg $flag testgrid.pbm | wc -c ; echo ${PIPESTATUS[0]} + pamtopdbimg $flag testgrid.pbm | wc -c | tr -d ' ' + echo ${PIPESTATUS[0]} done + # Test 4. large notefile # Should succeed twice and fail once, producing: # 3344 @@ -76,11 +82,14 @@ awk 'BEGIN { ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; head -c 65533 ${text65597} > ${text65533} head -c 65534 ${text65597} > ${text65534} -pamtopdbimg -uncompressed testgrid.pbm | wc -c +pamtopdbimg -uncompressed testgrid.pbm | \ + wc -c | tr -d ' ' echo ${PIPESTATUS[0]} -pamtopdbimg -uncompressed -notefile=${text65533} testgrid.pbm | wc -c +pamtopdbimg -uncompressed -notefile=${text65533} testgrid.pbm | \ + wc -c | tr -d ' ' echo ${PIPESTATUS[0]} -pamtopdbimg -uncompressed -notefile=${text65534} testgrid.pbm | wc -c +pamtopdbimg -uncompressed -notefile=${text65534} testgrid.pbm | \ + wc -c | tr -d ' ' echo ${PIPESTATUS[0]} rm ${text65533} ${text65534} ${text65597} \ No newline at end of file -- cgit 1.4.1