diff options
Diffstat (limited to 'test/pbmtext-iso88591.test')
-rwxr-xr-x | test/pbmtext-iso88591.test | 46 |
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 |