2005-10-05 19:37:46 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
fail ()
|
|
|
|
{
|
|
|
|
echo "Test failed: $*"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
echo_v ()
|
|
|
|
{
|
|
|
|
if [ "$verbose" = "1" ]; then
|
|
|
|
echo "$*"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "-v" ]; then
|
|
|
|
verbose=1
|
|
|
|
fi
|
2020-02-25 12:47:46 +01:00
|
|
|
for I in "${srcdir:-.}"/collate/*.in; do
|
2005-10-05 19:37:46 +02:00
|
|
|
echo_v "Sorting $I"
|
2020-02-25 12:47:46 +01:00
|
|
|
name=$(basename "${I}" .in)
|
|
|
|
./unicode-collate "${I}" > collate.out
|
2006-12-24 22:47:05 +01:00
|
|
|
if [ $? -eq 2 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2020-02-25 12:47:46 +01:00
|
|
|
diff collate.out "${srcdir:-.}/collate/$name.unicode" ||
|
2005-10-05 19:37:46 +02:00
|
|
|
fail "unexpected error when using g_utf8_collate() on $I"
|
2020-02-25 12:47:46 +01:00
|
|
|
./unicode-collate --key "${I}" > collate.out
|
|
|
|
diff collate.out "${srcdir:-.}/collate/$name.unicode" ||
|
2005-10-05 19:37:46 +02:00
|
|
|
fail "unexpected error when using g_utf8_collate_key() on $I"
|
2020-02-25 12:47:46 +01:00
|
|
|
./unicode-collate --file "${I}" > collate.out
|
|
|
|
diff collate.out "${srcdir:-.}/collate/$name.file" ||
|
2005-10-05 19:37:46 +02:00
|
|
|
fail "unexpected error when using g_utf8_collate_key_for_filename() on $I"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo_v "All tests passed."
|