about summary refs log tree commit diff
path: root/test/pbmtext-utf8.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-04-21 00:05:00 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-04-21 00:05:00 +0000
commit04c717a4cccf6cce662138d3286a449770f478eb (patch)
tree0ade37451a711ba5cb5ccce5b6724f89a28ba821 /test/pbmtext-utf8.test
parent8f4281c6439fd51d7659e3e41bf5d4040a3b68cb (diff)
downloadnetpbm-mirror-04c717a4cccf6cce662138d3286a449770f478eb.tar.gz
netpbm-mirror-04c717a4cccf6cce662138d3286a449770f478eb.tar.xz
netpbm-mirror-04c717a4cccf6cce662138d3286a449770f478eb.zip
Test invalid command line arguments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4090 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pbmtext-utf8.test')
-rwxr-xr-xtest/pbmtext-utf8.test50
1 files changed, 28 insertions, 22 deletions
diff --git a/test/pbmtext-utf8.test b/test/pbmtext-utf8.test
index 8ebb6e31..0677d161 100755
--- a/test/pbmtext-utf8.test
+++ b/test/pbmtext-utf8.test
@@ -7,7 +7,7 @@ LC_ALL=C
 export LANG LC_ALL
 
 
-# This test requires a working UTF-8 locale 
+# This test requires a working UTF-8 locale
 # Skip this test if it is are not available
 
 iconv /dev/null
@@ -22,11 +22,11 @@ utf_locale_list=${tmpdir}/utf_locale_list
 
 locale_to_test="en_US.utf8"  # Initial value
 # Edit the above value if necessary
-  
+
 # Make a list of available locales which end in "utf8"
 locale -a | grep "\.utf8$" > ${utf_locale_list}
 
-# Hunt for a valid utf8 locale  
+# Hunt for a valid utf8 locale
 # Submit each candidate to a trial pbmtext run until one that works is
 # encountered
 
@@ -142,12 +142,15 @@ cat ${long_txt} | \
   LC_ALL=${locale_for_test} \
   pbmtext -nomargins -builtin fixed -wchar > ${test_out} || \
   echo -n "Expected failure 1";
-  test -s ${test_out}; echo " "$? 
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
+
 cat ${long_txt} | \
   LC_ALL=${locale_for_test} \
   pbmtext -nomargins -builtin fixed -wchar > ${test_out} || \
   echo -n "Expected failure 2";
-  test -s ${test_out}; echo " "$?  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
 
 rm ${long_txt}
 
@@ -165,39 +168,42 @@ echo "Test 6 Invalid"
 
 awk 'BEGIN { printf("%c%c",128,129);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-1:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$?  
-  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
+
 awk 'BEGIN { printf("ABC%c%c",192, 193);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-2:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$?  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
 
 awk 'BEGIN { printf("abcde%c%c", 254, 253);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-3:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$?  
-  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
+
 awk 'BEGIN { printf("abcdefg%c%c", 195, 15);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-4:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$?  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
 
 awk 'BEGIN { printf("123456789%c%c%c", 224, 143 ,0);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-5:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$?  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}
 
 awk 'BEGIN { printf("abcdefg123ABCDEFG%c%c%c%c",247, 135, 135, 7);  print ""}' | \
         LC_ALL=${locale_for_test} \
-        pbmtext -builtin bdf -wchar -text-dump > ${test_out} 
+        pbmtext -builtin bdf -wchar -text-dump > ${test_out}
   echo -n "6-6:" ${PIPESTATUS[@]} ":" $?
-  test -s ${test_out}; echo " "$? 
-  
-rm ${test_out}
-  
+  test -s ${test_out}; echo " "$?
+  rm -f ${test_out}