~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/locale/koi8-to-win1251/runall

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

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