about summary refs log tree commit diff
path: root/test/pbmtext-iso88591.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-06-28 23:45:11 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-06-28 23:45:11 +0000
commitcdf6e0151411d887fef61245cb303ef190b29335 (patch)
tree678c2212e125e66e0a868773e2b4ec460794da4e /test/pbmtext-iso88591.test
parentde1311e820dc892f1a3c5c9ae70dbc56868030d8 (diff)
downloadnetpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.tar.gz
netpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.tar.xz
netpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.zip
Promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3641 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pbmtext-iso88591.test')
-rwxr-xr-xtest/pbmtext-iso88591.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/pbmtext-iso88591.test b/test/pbmtext-iso88591.test
new file mode 100755
index 00000000..bc5e83ab
--- /dev/null
+++ b/test/pbmtext-iso88591.test
@@ -0,0 +1,46 @@
+#! /bin/bash
+# This script tests: pbmtext
+# Also requires:
+
+# This test requires the following locale:
+#   LC_ALL en_US.iso88591
+# Skip this test if it is not available
+
+iconv /dev/null
+if [ $? -ne 0  ]
+  then echo "iconv command not available." 1>&2
+       echo "Skipping." 1>&2
+  exit 80;
+fi
+
+echo "A" | LC_ALL=en_US.iso88591 pbmtext -wchar > /dev/null
+if [ $? -ne 0  ]
+  then echo "LC_ALL could not be set to en_US.iso88591" 1>&2
+       echo "Skipping." 1>&2
+  exit 80;
+fi
+
+# Two rows
+# Should print 3806607098 5110 twice
+LC_ALL=C \
+awk 'BEGIN { for (i=32; i<=126;++i) printf("%c",i); print ""; \
+             for (i=160;i<=255;++i) printf("%c",i); }' | \
+    pbmtext -builtin bdf | cksum
+
+
+LC_ALL=C \
+awk 'BEGIN { for (i=32; i<=126;++i) printf("%c",i); print ""; \
+             for (i=160;i<=255;++i) printf("%c",i); }' | \
+    LC_ALL=en_US.iso88591 pbmtext -builtin bdf -wchar | cksum
+
+
+# Two rows
+# Should print 2858870527 192 twice
+LC_ALL=C \
+awk 'BEGIN { for (i=32; i<=126;++i) printf("%c",i); print ""; \
+             for (i=161;i<=255;++i) printf("%c",i); print "" }' | cksum
+
+LC_ALL=C \
+awk 'BEGIN { for (i=32; i<=126;++i) printf("%c",i); print ""; \
+             for (i=161;i<=255;++i) printf("%c",i); print ""}' | \
+    LC_ALL=en_US.iso88591 pbmtext -builtin bdf -wchar -text-dump | cksum
\ No newline at end of file