diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-28 02:40:42 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-28 02:40:42 +0000 |
commit | 34546ecb9b586f34e04f6e133a247ffe1f50046e (patch) | |
tree | 55c0c6c76c55bfe99a9f3c7dec416604a1c6dbd9 /test/pbmtext-iso88591.test | |
parent | d484f36f7c690d0a88476127afd9bdf90233699d (diff) | |
download | netpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.tar.gz netpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.tar.xz netpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.zip |
Release 1.04.00
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4700 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pbmtext-iso88591.test')
-rwxr-xr-x | test/pbmtext-iso88591.test | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/pbmtext-iso88591.test b/test/pbmtext-iso88591.test index 6df296dd..e8dec8d2 100755 --- a/test/pbmtext-iso88591.test +++ b/test/pbmtext-iso88591.test @@ -3,7 +3,7 @@ # Also requires: # This test requires an iso-8859-1 locale -# Skip this test if it is not available +# Skip this test if none are available LANG=C LC_ALL=C @@ -12,26 +12,29 @@ export LANG LC_ALL tmpdir=${tmpdir:-/tmp} iso88591_locale_list=${tmpdir}/iso88591_locale_list - -locale_to_test="en_US.iso88591" # Initial value +locale_to_test="en_US.iso88591" # Initial value; this +# does not have to be present in # Edit the above value if necessary - + # Make a list of available locales which end in "iso88591" -locale -a | grep "\.iso88591$" > ${iso88591_locale_list} +# If none are found, abort test -# Hunt for a valid iso-8859-1 locale +locale -a | grep "\.iso88591$" > ${iso88591_locale_list} ||\ + locale_to_test="" + +# Hunt for a valid iso-8859-1 locale # Submit each candidate to a trial pbmtext run until one that works is # encountered -i=0 until [ -z ${locale_to_test} ] || \ echo "A" | LC_ALL=${locale_to_test} pbmtext -wchar > /dev/null do - let i=$(($i+1)); - locale_to_test=`sed "$i"p -n ${iso88591_locale_list}`; + # Read first line of file + locale_to_test=`head -n 1 ${iso88591_locale_list}`; + # then erase the line + sed -i 1d ${iso88591_locale_list}; done; -rm ${iso88591_locale_list}; if [ -z ${locale_to_test} ] then echo "No iso-8859-1 locale available." 1>&2 echo "Skipping." 1>&2 @@ -42,7 +45,6 @@ fi; locale_for_test=${locale_to_test}; - # Two rows # Should print 2066913605 5110 twice echo "Test 1" |