2 # Complete check of a stateless encoding.
3 # Usage: check-stateless SRCDIR CHARSET
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
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
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