about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-18 03:40:11 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-18 03:40:11 +0000
commit54a249d24811a5841b853f9a88a0c5c9871133e3 (patch)
tree2f8f73356fe67e979d5cb4e490a4514a6db14f39 /test
parent5e879ac7c25e300b051e98ad3cad704bacae99b1 (diff)
downloadnetpbm-mirror-54a249d24811a5841b853f9a88a0c5c9871133e3.tar.gz
netpbm-mirror-54a249d24811a5841b853f9a88a0c5c9871133e3.tar.xz
netpbm-mirror-54a249d24811a5841b853f9a88a0c5c9871133e3.zip
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
Diffstat (limited to 'test')
-rwxr-xr-xtest/pamtopdbimg.test17
1 files changed, 13 insertions, 4 deletions
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