This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5db: add tests for v command
[perl5.git] / t / uni / greek.t
CommitLineData
b5b7b9ad
NC
1#!./perl -w
2
9e08bc66 3BEGIN {
b5efbd1f 4 chdir 't' if -d 't';
9e08bc66 5 require './test.pl';
a15a3d9b 6 skip_all("encoding.pm is no longer supported by the perl core");
9e08bc66
ST
7}
8
9plan tests => 72;
10
55673181 11no warnings 'deprecated';
9e08bc66
ST
12use encoding "greek"; # iso 8859-7
13
14# U+0391, \xC1, \301, GREEK CAPITAL LETTER ALPHA
15# U+03B1, \xE1, \341, GREEK SMALL LETTER ALPHA
16
17ok("\xC1" =~ /\xC1/, '\xC1 to /\xC1/');
18ok("\x{391}" =~ /\xC1/, '\x{391} to /\xC1/');
19ok("\xC1" =~ /\x{C1}/, '\xC1 to /\x{C1}/');
20ok("\x{391}" =~ /\x{C1}/, '\x{391} to /\x{C1}/');
21ok("\xC1" =~ /\301/, '\xC1 to /\301/');
22ok("\x{391}" =~ /\301/, '\x{391} to /\301/');
23ok("\xC1" =~ /\x{391}/, '\xC1 to /\x{391}/');
24ok("\x{391}" =~ /\x{391}/, '\x{391} to /\x{391}/');
25
26ok("\xC1" =~ /\xC1/i, '\xC1 to /\xC1/i');
27ok("\xE1" =~ /\xC1/i, '\xE1 to /\xC1/i');
28ok("\xC1" =~ /\xE1/i, '\xC1 to /\xE1/i');
29ok("\xE1" =~ /\xE1/i, '\xE1 to /\xE1/i');
30ok("\xC1" =~ /\x{391}/i, '\xC1 to /\x{391}/i');
31ok("\xE1" =~ /\x{391}/i, '\xE1 to /\x{391}/i');
32ok("\xC1" =~ /\x{3B1}/i, '\xC1 to /\x{3B1}/i');
33ok("\xE1" =~ /\x{3B1}/i, '\xE1 to /\x{3B1}/i');
34
35ok("\xC1" =~ /[\xC1]/, '\xC1 to /[\xC1]/');
36ok("\x{391}" =~ /[\xC1]/, '\x{391} to /[\xC1]/');
37ok("\xC1" =~ /[\x{C1}]/, '\xC1 to /[\x{C1}]/');
38ok("\x{391}" =~ /[\x{C1}]/, '\x{391} to /[\x{C1}]/');
39ok("\xC1" =~ /[\301]/, '\xC1 to /[\301]/');
40ok("\x{391}" =~ /[\301]/, '\x{391} to /[\301]/');
41ok("\xC1" =~ /[\x{391}]/, '\xC1 to /[\x{391}]/');
42ok("\x{391}" =~ /[\x{391}]/, '\x{391} to /[\x{391}]/');
43
44ok("\xC1" =~ /[\xC1]/i, '\xC1 to /[\xC1]/i');
45ok("\xE1" =~ /[\xC1]/i, '\xE1 to /[\xC1]/i');
46ok("\xC1" =~ /[\xE1]/i, '\xC1 to /[\xE1]/i');
47ok("\xE1" =~ /[\xE1]/i, '\xE1 to /[\xE1]/i');
48ok("\xC1" =~ /[\x{391}]/i, '\xC1 to /[\x{391}]/i');
49ok("\xE1" =~ /[\x{391}]/i, '\xE1 to /[\x{391}]/i');
50ok("\xC1" =~ /[\x{3B1}]/i, '\xC1 to /[\x{3B1}]/i');
51ok("\xE1" =~ /[\x{3B1}]/i, '\xE1 to /[\x{3B1}]/i');
52
53ok("\xC1" =~ '\xC1', '\xC1 to \'\xC1\'');
54ok("\xC1" =~ '\x{C1}', '\xC1 to \'\x{C1}\'');
55ok("\xC1" =~ '\301', '\xC1 to \'\301\'');
56ok("\xC1" =~ '\x{391}', '\xC1 to \'\x{391}\'');
57ok("\xC1" =~ '[\xC1]', '\xC1 to \'[\xC1]\'');
58ok("\xC1" =~ '[\x{C1}]', '\xC1 to \'[\x{C1}]\'');
59ok("\xC1" =~ '[\301]', '\xC1 to \'[\301]\'');
60ok("\xC1" =~ '[\x{391}]', '\xC1 to \'[\x{391}]\'');
61
62ok("\xC1" =~ /Á/, '\xC1 to /<ALPHA>/');
63ok("\xE1" !~ /Á/, '\xE1 to /<ALPHA>/');
64ok("\xC1" =~ /Á/i, '\xC1 to /<ALPHA>/i');
65ok("\xE1" =~ /Á/i, '\xE1 to /<ALPHA>/i');
66ok("\xC1" =~ /[Á]/, '\xC1 to /[<ALPHA>]/');
67ok("\xE1" !~ /[Á]/, '\xE1 to /[<ALPHA>]/');
68ok("\xC1" =~ /[Á]/i, '\xC1 to /[<ALPHA>]/i');
69ok("\xE1" =~ /[Á]/i, '\xE1 to /[<ALPHA>]/i');
70
71ok("\xC1\xC1" =~ /Á\xC1/, '\xC1\xC1 to /<ALPHA>\xC1/');
72ok("\xC1\xC1" =~ /\xC1Á/, '\xC1\xC1 to /\xC1<ALPHA>/');
73ok("\xC1\xC1" =~ /Á\xC1/i, '\xC1\xC1 to /<ALPHA>\xC1/i');
74ok("\xC1\xC1" =~ /\xC1Á/i, '\xC1\xC1 to /\xC1<ALPHA>/i');
75ok("\xC1\xE1" =~ /Á\xC1/i, '\xC1\xE1 to /<ALPHA>\xC1/i');
76ok("\xC1\xE1" =~ /\xC1Á/i, '\xC1\xE1 to /\xC1<ALPHA>/i');
77ok("\xE1\xE1" =~ /Á\xC1/i, '\xE1\xE1 to /<ALPHA>\xC1/i');
78ok("\xE1\xE1" =~ /\xC1Á/i, '\xE1\xE1 to /\xC1<ALPHA>/i');
79
80# U+038A, \xBA, GREEK CAPITAL LETTER IOTA WITH TONOS
81# U+03AF, \xDF, GREEK SMALL LETTER IOTA WITH TONOS
82
83ok("\x{38A}" =~ /\xBA/, '\x{38A} to /\xBA/');
84ok("\x{38A}" !~ /\xDF/, '\x{38A} to /\xDF/');
85ok("\x{38A}" =~ /\xBA/i, '\x{38A} to /\xBA/i');
86ok("\x{38A}" =~ /\xDF/i, '\x{38A} to /\xDF/i');
87ok("\x{38A}" =~ /[\xBA]/, '\x{38A} to /[\xBA]/');
88ok("\x{38A}" !~ /[\xDF]/, '\x{38A} to /[\xDF]/');
89ok("\x{38A}" =~ /[\xBA]/i, '\x{38A} to /[\xBA]/i');
90ok("\x{38A}" =~ /[\xDF]/i, '\x{38A} to /[\xDF]/i');
91
92# \xDF is not LATIN SMALL LETTER SHARP S
93
94ok("SS" !~ /\xDF/i, 'SS to /\xDF/i');
95ok("Ss" !~ /\xDF/i, 'Ss to /\xDF/i');
96ok("sS" !~ /\xDF/i, 'sS to /\xDF/i');
97ok("ss" !~ /\xDF/i, 'ss to /\xDF/i');
98ok("SS" !~ /ß/i, 'SS to /<iota-tonos>/i');
99ok("Ss" !~ /ß/i, 'Ss to /<iota-tonos>/i');
100ok("sS" !~ /ß/i, 'sS to /<iota-tonos>/i');
101ok("ss" !~ /ß/i, 'ss to /<iota-tonos>/i');
102