Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4373c4d

Browse files
committed
Addition to test/locale submitted by Oleg Broytmann. Comments from him:
There are two subdirectories (ISO8859-7 and koi8-to-win1251) containing tests for Greek locale and server<=>client recoding feature (recently submitted by Tatsuo Ishii <t-ishii@sra.co.jp>; we've debugged his patches together in the field of Cyrillic support).
1 parent c2d5949 commit 4373c4d

25 files changed

+880
-2
lines changed

src/test/locale/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CFLAGS+= $(KRBFLAGS)
1414
endif
1515

1616
PROGS = test-pgsql-locale test-ctype
17-
DIRS = koi8-r
17+
DIRS = koi8-r ISO8859-7 koi8-to-win1251
1818

1919
all: $(PROGS)
2020

src/test/locale/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ think) method is just copy koi8-r directory and edit/replace files.
2424

2525
Oleg.
2626
----
27-
Oleg Broytmann http://members.tripod.com/~phd2/ phd2@earthling.net
27+
Oleg Broytmann http://members.xoom.com/phd2/ phd2@earthling.net
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Makefile for example programs
3+
#
4+
5+
all:
6+
-@echo "make: Nothing to be done for \`all'."
7+
8+
test:
9+
@./runall
10+
11+
clean:
12+
rm -f *.out
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gr_GR.ISO8859-7 (Greek) locale test.
2+
Created by Angelos Karageorgiou <angelos@awesome.incredible.com>

src/test/locale/gr_GR.ISO8859-7/expected/gr-ctype.out

+257
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
abbrev|name_en |name_gr
2+
------+--------------------+------------------------------------------------------------
3+
AK |Alaska |������
4+
AL |Alabama |��������
5+
AZ |Arizona |�������
6+
AR |Arkansas |��������
7+
ID |Idaho |�������
8+
IA |Iowa |�����
9+
VT |Vermont |�������
10+
VA |Virginia |���������
11+
NC |North Carolina |������ ��������
12+
ND |North Dakota |������ �������
13+
UT |Utah |������
14+
WY |Wyoming |�����������
15+
WV |West Virginia |������ ���������
16+
WI |Wisconsin |�����������
17+
WA |Washington |������������
18+
DC |Washington DC |����������� ��� ��
19+
IL |Illinois |��������
20+
IN |Indiana |�������
21+
KA |Kansas |������
22+
CA |California |����������
23+
KY |Kentucky |�������
24+
CO |Colorado |���������
25+
CT |Connecticut |�����������
26+
LA |Louisiana |���������
27+
ME |Maine |����
28+
MI |Michigan |���������
29+
MD |Maryland |���������
30+
MA |Massachusetts |������������
31+
MN |Minnesota |���������
32+
MS |Mississippi |���������
33+
MO |Missouri |��������
34+
MT |Montana |�������
35+
NJ |New Jersey |��� ������
36+
NY |New York |��� �����
37+
NM |New Mexico |��� ������
38+
NH |New Hampshire |��� ��������
39+
NV |Nevada |������
40+
NE |Nebraska |���������
41+
DE |Delaware |����������
42+
SC |South Carolina |����� ��������
43+
SD |South Dakota |����� �������
44+
OK |Oklahoma |��������
45+
OR |Oregon |�������
46+
OH |Ohio |�����
47+
PA |Pennsylvania |������������
48+
RI |Rhode Island |������ ������
49+
TX |Texas |�����
50+
TN |Tennessee |�������
51+
GA |Georgia |��������
52+
FL |Florida |��������
53+
(50 rows)
54+
55+
EOF
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
abbrev|name_en |name_gr
2+
------+--------------------+------------------
3+
UT |Utah |������
4+
WY |Wyoming |�����������
5+
WV |West Virginia |������ ���������
6+
WI |Wisconsin |�����������
7+
WA |Washington |������������
8+
DC |Washington DC |����������� ��� ��
9+
(6 rows)
10+
11+
EOF
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Bording
2+
Sorting
3+
hoarding
4+
�������
5+
������
6+
���������
7+
����
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
abbrev|name_en |name_gr
2+
------+--------------------+------------------
3+
AK |Alaska |������
4+
AL |Alabama |��������
5+
AZ |Arizona |�������
6+
AR |Arkansas |��������
7+
ID |Idaho |�������
8+
IA |Iowa |�����
9+
VT |Vermont |�������
10+
VA |Virginia |���������
11+
NC |North Carolina |������ ��������
12+
ND |North Dakota |������ �������
13+
UT |Utah |������
14+
WY |Wyoming |�����������
15+
WV |West Virginia |������ ���������
16+
WI |Wisconsin |�����������
17+
WA |Washington |������������
18+
DC |Washington DC |����������� ��� ��
19+
IL |Illinois |��������
20+
IN |Indiana |�������
21+
KA |Kansas |������
22+
CA |California |����������
23+
KY |Kentucky |�������
24+
CO |Colorado |���������
25+
CT |Connecticut |�����������
26+
LA |Louisiana |���������
27+
ME |Maine |����
28+
MI |Michigan |���������
29+
MD |Maryland |���������
30+
MA |Massachusetts |������������
31+
MN |Minnesota |���������
32+
MS |Mississippi |���������
33+
MO |Missouri |��������
34+
MT |Montana |�������
35+
NJ |New Jersey |��� ������
36+
NY |New York |��� �����
37+
NM |New Mexico |��� ������
38+
NH |New Hampshire |��� ��������
39+
NV |Nevada |������
40+
NE |Nebraska |���������
41+
DE |Delaware |����������
42+
SC |South Carolina |����� ��������
43+
SD |South Dakota |����� �������
44+
OK |Oklahoma |��������
45+
OR |Oregon |�������
46+
OH |Ohio |�����
47+
PA |Pennsylvania |������������
48+
RI |Rhode Island |������ ������
49+
TX |Texas |�����
50+
TN |Tennessee |�������
51+
GA |Georgia |��������
52+
FL |Florida |��������
53+
(50 rows)
54+
55+
EOF
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
abbrev|name_en |name_gr
2+
------+--------------------+------------------
3+
AK |Alaska |������
4+
AL |Alabama |��������
5+
AZ |Arizona |�������
6+
AR |Arkansas |��������
7+
ID |Idaho |�������
8+
IA |Iowa |�����
9+
VT |Vermont |�������
10+
VA |Virginia |���������
11+
NC |North Carolina |������ ��������
12+
ND |North Dakota |������ �������
13+
UT |Utah |������
14+
WY |Wyoming |�����������
15+
WV |West Virginia |������ ���������
16+
WI |Wisconsin |�����������
17+
WA |Washington |������������
18+
DC |Washington DC |����������� ��� ��
19+
IL |Illinois |��������
20+
IN |Indiana |�������
21+
KA |Kansas |������
22+
CA |California |����������
23+
KY |Kentucky |�������
24+
CO |Colorado |���������
25+
CT |Connecticut |�����������
26+
LA |Louisiana |���������
27+
ME |Maine |����
28+
MI |Michigan |���������
29+
MD |Maryland |���������
30+
MA |Massachusetts |������������
31+
MN |Minnesota |���������
32+
MS |Mississippi |���������
33+
MO |Missouri |��������
34+
MT |Montana |�������
35+
NJ |New Jersey |��� ������
36+
NY |New York |��� �����
37+
NM |New Mexico |��� ������
38+
NH |New Hampshire |��� ��������
39+
NV |Nevada |������
40+
NE |Nebraska |���������
41+
DE |Delaware |����������
42+
SC |South Carolina |����� ��������
43+
SD |South Dakota |����� �������
44+
OK |Oklahoma |��������
45+
OR |Oregon |�������
46+
OH |Ohio |�����
47+
PA |Pennsylvania |������������
48+
RI |Rhode Island |������ ������
49+
TX |Texas |�����
50+
TN |Tennessee |�������
51+
GA |Georgia |��������
52+
FL |Florida |��������
53+
(50 rows)
54+
55+
EOF
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#! /bin/sh
2+
3+
PATH=..:$PATH
4+
5+
echo "Testing PostgreSQL compilation..."
6+
if ! test-pgsql-locale; then
7+
exit 1
8+
fi
9+
10+
LC_CTYPE=gr_GR.ISO8859-7
11+
LC_COLLATE=$LC_CTYPE
12+
export LC_CTYPE LC_COLLATE
13+
14+
echo "Testing LC_CTYPE..."
15+
if ! test-ctype > gr-ctype.out; then
16+
exit 1
17+
fi
18+
diff expected/gr-ctype.out gr-ctype.out
19+
20+
echo "Testing LC_COLLATE..."
21+
perl ../sort-test.pl test-gr-sort.in > test-gr-sort.out
22+
diff expected/test-gr-sort.out test-gr-sort.out
23+
24+
### If you have Python - uncomment the following two lines
25+
#python ../sort-test.py test-gr-sort.in > test-gr-sort.out
26+
#diff expected/test-gr-sort.out test-gr-sort.out
27+
28+
29+
abort() {
30+
[ "$1" ] && echo "$*"
31+
exit 1
32+
}
33+
34+
for f in char varchar text; do
35+
if echo $f | grep -q char; then
36+
ftype="$f(60)"
37+
else
38+
ftype="$f"
39+
fi
40+
echo "Testing PgSQL: sort on $ftype type..."
41+
42+
destroydb testlocale >/dev/null 2>&1
43+
createdb testlocale || abort "createdb failed"
44+
psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed"
45+
psql testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed"
46+
diff expected/test-gr-$f.sql.out test-gr-$f.sql.out
47+
done
48+
echo "Testing PgSQL: select on regexp..."
49+
psql testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed"
50+
diff expected/test-gr-select.sql.out test-gr-select.sql.out
51+
destroydb testlocale || abort "destroydb failed"
52+
echo "Finished."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FROM usastates WHERE name_gr ~* '^�.*' ORDER BY name_gr;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Sorting
2+
������
3+
���������
4+
����
5+
�������
6+
Bording
7+
hoarding
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
COPY usastates FROM stdin USING DELIMITERS '|';
2+
AK|Alaska |������
3+
WA|Washington |������������
4+
OR|Oregon |�������
5+
CA|California |����������
6+
NV|Nevada |������
7+
ID|Idaho |�������
8+
UT|Utah |������
9+
AZ|Arizona |�������
10+
MT|Montana |�������
11+
WY|Wyoming |�����������
12+
CO|Colorado |���������
13+
NM|New Mexico |��� ������
14+
ND|North Dakota |������ �������
15+
SD|South Dakota |����� �������
16+
NE|Nebraska |���������
17+
KA|Kansas |������
18+
OK|Oklahoma |��������
19+
TX|Texas |�����
20+
MN|Minnesota |���������
21+
IA|Iowa |�����
22+
MO|Missouri |��������
23+
AR|Arkansas |��������
24+
LA|Louisiana |���������
25+
WI|Wisconsin |�����������
26+
IL|Illinois |��������
27+
IN|Indiana |�������
28+
MS|Mississippi |���������
29+
AL|Alabama |��������
30+
MI|Michigan |���������
31+
OH|Ohio |�����
32+
KY|Kentucky |�������
33+
TN|Tennessee |�������
34+
GA|Georgia |��������
35+
FL|Florida |��������
36+
PA|Pennsylvania |������������
37+
WV|West Virginia |������ ���������
38+
VA|Virginia |���������
39+
NC|North Carolina|������ ��������
40+
SC|South Carolina|����� ��������
41+
NY|New York |��� �����
42+
NJ|New Jersey |��� ������
43+
DE|Delaware |����������
44+
MD|Maryland |���������
45+
DC|Washington DC |����������� ��� ��
46+
VT|Vermont |�������
47+
MA|Massachusetts |������������
48+
CT|Connecticut |�����������
49+
ME|Maine |����
50+
NH|New Hampshire |��� ��������
51+
RI|Rhode Island |������ ������
52+
\.
53+
SELECT * FROM usastates ORDER BY name_gr;
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Makefile for example programs
3+
#
4+
5+
all:
6+
-@echo "make: Nothing to be done for \`all'."
7+
8+
test:
9+
@./runall
10+
11+
clean:
12+
rm -f *.out
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
koi8-to-win1251 test. The database should be created in koi8 (createdb -E koi8),
2+
test uses koi8-to-win1251 converting feature.
3+
Created by Oleg Broytmann <phd2@earthling.net>. Code for encodings
4+
converting created by Tatsuo Ishii <t-ishii@sra.co.jp>.

0 commit comments

Comments
 (0)