Add comments: glibc now implements the X11 encoding names.
[libiconv.git] / tests / check-stateless
blob632deecc44defea2d204928a08bbc96189cacfe7
1 #!/bin/sh
2 # Complete check of a stateless encoding.
3 # Usage: check-stateless SRCDIR CHARSET
4 srcdir="$1"
5 charset="$2"
6 set -e
7 ./table-from "$charset" > tmp-"$charset".TXT
8 ./table-to "$charset" | sort > tmp-"$charset".INVERSE.TXT
9 cmp "${srcdir}"/"$charset".TXT tmp-"$charset".TXT 2> /dev/null
10 if test -f "${srcdir}"/"$charset".IRREVERSIBLE.TXT; then
11 cat "${srcdir}"/"$charset".TXT "${srcdir}"/"$charset".IRREVERSIBLE.TXT | sort | uniq -u > tmp-orig-"$charset".INVERSE.TXT
12 cmp tmp-orig-"$charset".INVERSE.TXT tmp-"$charset".INVERSE.TXT 2> /dev/null
13 else
14 cmp "${srcdir}"/"$charset".TXT tmp-"$charset".INVERSE.TXT 2> /dev/null
16 rm -f tmp-"$charset".TXT tmp-"$charset".INVERSE.TXT tmp-orig-"$charset".INVERSE.TXT
17 exit 0
18 # For a new encoding:
19 # You can create the "$charset".TXT like this:
20 # ./table-from "$charset" > "$charset".TXT
21 # You can create the "$charset".IRREVERSIBLE.TXT like this:
22 # ./table-to "$charset" | sort > "$charset".INVERSE.TXT
23 # diff "$charset".TXT "$charset".INVERSE.TXT | grep '^[<>]' | sed -e 's,^. ,,' > "$charset".IRREVERSIBLE.TXT