mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
Add Collation tests.
2005-10-05 Matthias Clasen <mclasen@redhat.com> * Makefile.am: Add Collation tests. * tests/collate/*: Inputs and expected outputs for collation tests. * tests/run-collate-tests.sh: Script to run collation tests. * tests/unicode-collate.c (main): Rework slightly to make it usable in unit tests. Also test g_utf8_collate_key_for_filename().
This commit is contained in:
committed by
Matthias Clasen
parent
12e2c276b5
commit
d433419b14
38
tests/run-collate-tests.sh
Executable file
38
tests/run-collate-tests.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#! /bin/sh
|
||||
|
||||
fail ()
|
||||
{
|
||||
echo "Test failed: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo_v ()
|
||||
{
|
||||
if [ "$verbose" = "1" ]; then
|
||||
echo "$*"
|
||||
fi
|
||||
}
|
||||
|
||||
error_out=/dev/null
|
||||
if [ "$1" = "-v" ]; then
|
||||
verbose=1
|
||||
error_out=/dev/stderr
|
||||
fi
|
||||
for I in ${srcdir:-.}/collate/*.in; do
|
||||
echo_v "Sorting $I"
|
||||
name=`basename $I .in`
|
||||
./unicode-collate $I > collate.out
|
||||
if ! diff collate.out ${srcdir:-.}/collate/$name.unicode; then
|
||||
fail "unexpected error when using g_utf8_collate() on $I"
|
||||
fi
|
||||
./unicode-collate --key $I > collate.out
|
||||
if ! diff collate.out ${srcdir:-.}/collate/$name.unicode; then
|
||||
fail "unexpected error when using g_utf8_collate_key() on $I"
|
||||
fi
|
||||
./unicode-collate --file $I > collate.out
|
||||
if ! diff collate.out ${srcdir:-.}/collate/$name.file; then
|
||||
fail "unexpected error when using g_utf8_collate_key_for_filename() on $I"
|
||||
fi
|
||||
done
|
||||
|
||||
echo_v "All tests passed."
|
Reference in New Issue
Block a user