about summary refs log tree commit diff
path: root/test/pbmtext-iso88591.test
blob: bc5e83abf877b8e7d45d379d219229eec6041653 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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