diff options
author | Bruno Haible <bruno@clisp.org> | 2006-03-29 11:28:41 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:13:05 +0200 |
commit | 6e8fdd25159688fa14742329bcdf3ffb92f92a13 (patch) | |
tree | eac4e2867d11d6438aa8372044cadec36d073dd5 /gettext-tools/tests | |
parent | 165d0b7a1695ecf6feb38882c84f61484216eb66 (diff) | |
download | external_gettext-6e8fdd25159688fa14742329bcdf3ffb92f92a13.zip external_gettext-6e8fdd25159688fa14742329bcdf3ffb92f92a13.tar.gz external_gettext-6e8fdd25159688fa14742329bcdf3ffb92f92a13.tar.bz2 |
Test recode-sr-latin on some input in EUC-JP encoding.
Diffstat (limited to 'gettext-tools/tests')
-rwxr-xr-x | gettext-tools/tests/recode-sr-latin-2 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gettext-tools/tests/recode-sr-latin-2 b/gettext-tools/tests/recode-sr-latin-2 new file mode 100755 index 0000000..62aa343 --- /dev/null +++ b/gettext-tools/tests/recode-sr-latin-2 @@ -0,0 +1,48 @@ +#! /bin/sh + +# Test recode-sr-latin on some input in EUC-JP encoding. +# (Apart from UTF-8 and GB18030, EUC-JP is the only common encoding that is +# a superset of both ISO-8859-5 and ISO-8859-2.) + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA_EUCJP=ja_JP.EUC-JP} +if test $LOCALE_JA_EUCJP != none; then + LC_ALL=$LOCALE_JA_EUCJP ./testlocale 2>/dev/null + case $? in + 0) ;; + 77) LOCALE_JA_EUCJP=none;; + *) exit 1;; + esac +fi +if test $LOCALE_JA_EUCJP = none; then + rm -fr $tmpfiles; exit 77 +fi + +tmpfiles="$tmpfiles rec-srl-2.in" +cat <<\EOF > rec-srl-2.in +妒扼扭把忘志扶我 忘把忍批技快扶找我 扼批 +扶快村快忱扶抉戒扶忘折忘扶 忘把忍批技快扶找 +EOF + +tmpfiles="$tmpfiles rec-srl-2.out" +: ${RECODE=recode} +LC_ALL=$LOCALE_JA_EUCJP \ +${RECODE}-sr-latin < rec-srl-2.in > rec-srl-2.out \ + || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles rec-srl-2.ok" +cat <<\EOF > rec-srl-2.ok +Ispravni argumenti su +nejednozna垠an argument +EOF + +: ${DIFF=diff} +${DIFF} rec-srl-2.ok rec-srl-2.out +result=$? + +rm -fr $tmpfiles + +exit $result |