| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
PATH=..:$PATH |
| 4 |
|
| 5 |
echo "Testing PostgreSQL compilation..." |
| 6 |
|
| 7 |
LC_CTYPE=gr_GR.ISO8859-7 |
| 8 |
LC_COLLATE=$LC_CTYPE |
| 9 |
export LC_CTYPE LC_COLLATE |
| 10 |
|
| 11 |
echo "Testing LC_CTYPE..." |
| 12 |
if ! test-ctype > gr-ctype.out; then |
| 13 |
exit 1 |
| 14 |
fi |
| 15 |
diff expected/gr-ctype.out gr-ctype.out |
| 16 |
|
| 17 |
echo "Testing LC_COLLATE..." |
| 18 |
perl ../sort-test.pl test-gr-sort.in > test-gr-sort.out |
| 19 |
diff expected/test-gr-sort.out test-gr-sort.out |
| 20 |
|
| 21 |
### If you have Python - uncomment the following two lines |
| 22 |
#python ../sort-test.py test-gr-sort.in > test-gr-sort.out |
| 23 |
#diff expected/test-gr-sort.out test-gr-sort.out |
| 24 |
|
| 25 |
|
| 26 |
abort() { |
| 27 |
[ "$1" ] && echo "$*" |
| 28 |
exit 1 |
| 29 |
} |
| 30 |
|
| 31 |
for f in char varchar text; do |
| 32 |
if echo $f | grep -q char; then |
| 33 |
ftype="$f(60)" |
| 34 |
else |
| 35 |
ftype="$f" |
| 36 |
fi |
| 37 |
echo "Testing PgSQL: sort on $ftype type..." |
| 38 |
|
| 39 |
dropdb testlocale >/dev/null 2>&1 |
| 40 |
createdb testlocale || abort "createdb failed" |
| 41 |
psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed" |
| 42 |
psql -X testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed" |
| 43 |
diff expected/test-gr-$f.sql.out test-gr-$f.sql.out |
| 44 |
done |
| 45 |
echo "Testing PgSQL: select on regexp..." |
| 46 |
psql -X testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed" |
| 47 |
diff expected/test-gr-select.sql.out test-gr-select.sql.out |
| 48 |
dropdb testlocale || abort "dropdb failed" |
| 49 |
echo "Finished." |