xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/charnames.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gatemy @WARN;
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gateBEGIN {
6*0Sstevel@tonic-gate    unless(grep /blib/, @INC) {
7*0Sstevel@tonic-gate	chdir 't' if -d 't';
8*0Sstevel@tonic-gate	@INC = '../lib';
9*0Sstevel@tonic-gate	require './test.pl';
10*0Sstevel@tonic-gate    }
11*0Sstevel@tonic-gate    $SIG{__WARN__} = sub { push @WARN, @_ };
12*0Sstevel@tonic-gate}
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gaterequire File::Spec;
15*0Sstevel@tonic-gate
16*0Sstevel@tonic-gate$| = 1;
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gateprint "1..73\n";
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gateuse charnames ':full';
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gateprint "not " unless "Here\N{EXCLAMATION MARK}?" eq "Here!?";
23*0Sstevel@tonic-gateprint "ok 1\n";
24*0Sstevel@tonic-gate
25*0Sstevel@tonic-gate{
26*0Sstevel@tonic-gate  use bytes;			# TEST -utf8 can switch utf8 on
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate  print "# \$res=$res \$\@='$@'\nnot "
29*0Sstevel@tonic-gate    if $res = eval <<'EOE'
30*0Sstevel@tonic-gateuse charnames ":full";
31*0Sstevel@tonic-gate"Here: \N{CYRILLIC SMALL LETTER BE}!";
32*0Sstevel@tonic-gate1
33*0Sstevel@tonic-gateEOE
34*0Sstevel@tonic-gate      or $@ !~ /above 0xFF/;
35*0Sstevel@tonic-gate  print "ok 2\n";
36*0Sstevel@tonic-gate  # print "# \$res=$res \$\@='$@'\n";
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate  print "# \$res=$res \$\@='$@'\nnot "
39*0Sstevel@tonic-gate    if $res = eval <<'EOE'
40*0Sstevel@tonic-gateuse charnames 'cyrillic';
41*0Sstevel@tonic-gate"Here: \N{Be}!";
42*0Sstevel@tonic-gate1
43*0Sstevel@tonic-gateEOE
44*0Sstevel@tonic-gate      or $@ !~ /CYRILLIC CAPITAL LETTER BE.*above 0xFF/;
45*0Sstevel@tonic-gate  print "ok 3\n";
46*0Sstevel@tonic-gate}
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gate# If octal representation of unicode char is \0xyzt, then the utf8 is \3xy\2zt
49*0Sstevel@tonic-gateif (ord('A') == 65) { # as on ASCII or UTF-8 machines
50*0Sstevel@tonic-gate    $encoded_be = "\320\261";
51*0Sstevel@tonic-gate    $encoded_alpha = "\316\261";
52*0Sstevel@tonic-gate    $encoded_bet = "\327\221";
53*0Sstevel@tonic-gate    $encoded_deseng = "\360\220\221\215";
54*0Sstevel@tonic-gate}
55*0Sstevel@tonic-gateelse { # EBCDIC where UTF-EBCDIC may be used (this may be 1047 specific since
56*0Sstevel@tonic-gate       # UTF-EBCDIC is codepage specific)
57*0Sstevel@tonic-gate    $encoded_be = "\270\102\130";
58*0Sstevel@tonic-gate    $encoded_alpha = "\264\130";
59*0Sstevel@tonic-gate    $encoded_bet = "\270\125\130";
60*0Sstevel@tonic-gate    $encoded_deseng = "\336\102\103\124";
61*0Sstevel@tonic-gate}
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gatesub to_bytes {
64*0Sstevel@tonic-gate    pack"a*", shift;
65*0Sstevel@tonic-gate}
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gate{
68*0Sstevel@tonic-gate  use charnames ':full';
69*0Sstevel@tonic-gate
70*0Sstevel@tonic-gate  print "not " unless to_bytes("\N{CYRILLIC SMALL LETTER BE}") eq $encoded_be;
71*0Sstevel@tonic-gate  print "ok 4\n";
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate  use charnames qw(cyrillic greek :short);
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate  print "not " unless to_bytes("\N{be},\N{alpha},\N{hebrew:bet}")
76*0Sstevel@tonic-gate    eq "$encoded_be,$encoded_alpha,$encoded_bet";
77*0Sstevel@tonic-gate  print "ok 5\n";
78*0Sstevel@tonic-gate}
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate{
81*0Sstevel@tonic-gate    use charnames ':full';
82*0Sstevel@tonic-gate    print "not " unless "\x{263a}" eq "\N{WHITE SMILING FACE}";
83*0Sstevel@tonic-gate    print "ok 6\n";
84*0Sstevel@tonic-gate    print "not " unless length("\x{263a}") == 1;
85*0Sstevel@tonic-gate    print "ok 7\n";
86*0Sstevel@tonic-gate    print "not " unless length("\N{WHITE SMILING FACE}") == 1;
87*0Sstevel@tonic-gate    print "ok 8\n";
88*0Sstevel@tonic-gate    print "not " unless sprintf("%vx", "\x{263a}") eq "263a";
89*0Sstevel@tonic-gate    print "ok 9\n";
90*0Sstevel@tonic-gate    print "not " unless sprintf("%vx", "\N{WHITE SMILING FACE}") eq "263a";
91*0Sstevel@tonic-gate    print "ok 10\n";
92*0Sstevel@tonic-gate    print "not " unless sprintf("%vx", "\xFF\N{WHITE SMILING FACE}") eq "ff.263a";
93*0Sstevel@tonic-gate    print "ok 11\n";
94*0Sstevel@tonic-gate    print "not " unless sprintf("%vx", "\x{ff}\N{WHITE SMILING FACE}") eq "ff.263a";
95*0Sstevel@tonic-gate    print "ok 12\n";
96*0Sstevel@tonic-gate}
97*0Sstevel@tonic-gate
98*0Sstevel@tonic-gate{
99*0Sstevel@tonic-gate   use charnames qw(:full);
100*0Sstevel@tonic-gate   use utf8;
101*0Sstevel@tonic-gate
102*0Sstevel@tonic-gate    my $x = "\x{221b}";
103*0Sstevel@tonic-gate    my $named = "\N{CUBE ROOT}";
104*0Sstevel@tonic-gate
105*0Sstevel@tonic-gate    print "not " unless ord($x) == ord($named);
106*0Sstevel@tonic-gate    print "ok 13\n";
107*0Sstevel@tonic-gate}
108*0Sstevel@tonic-gate
109*0Sstevel@tonic-gate{
110*0Sstevel@tonic-gate   use charnames qw(:full);
111*0Sstevel@tonic-gate   use utf8;
112*0Sstevel@tonic-gate   print "not " unless "\x{100}\N{CENT SIGN}" eq "\x{100}"."\N{CENT SIGN}";
113*0Sstevel@tonic-gate   print "ok 14\n";
114*0Sstevel@tonic-gate}
115*0Sstevel@tonic-gate
116*0Sstevel@tonic-gate{
117*0Sstevel@tonic-gate  use charnames ':full';
118*0Sstevel@tonic-gate
119*0Sstevel@tonic-gate  print "not "
120*0Sstevel@tonic-gate      unless to_bytes("\N{DESERET SMALL LETTER ENG}") eq $encoded_deseng;
121*0Sstevel@tonic-gate  print "ok 15\n";
122*0Sstevel@tonic-gate}
123*0Sstevel@tonic-gate
124*0Sstevel@tonic-gate{
125*0Sstevel@tonic-gate  # 20001114.001
126*0Sstevel@tonic-gate
127*0Sstevel@tonic-gate  no utf8; # naked Latin-1
128*0Sstevel@tonic-gate
129*0Sstevel@tonic-gate  if (ord("�") == 0xc4) { # Try to do this only on Latin-1.
130*0Sstevel@tonic-gate      use charnames ':full';
131*0Sstevel@tonic-gate      my $text = "\N{LATIN CAPITAL LETTER A WITH DIAERESIS}";
132*0Sstevel@tonic-gate      print "not " unless $text eq "\xc4" && ord($text) == 0xc4;
133*0Sstevel@tonic-gate      print "ok 16\n";
134*0Sstevel@tonic-gate  } else {
135*0Sstevel@tonic-gate      print "ok 16 # Skip: not Latin-1\n";
136*0Sstevel@tonic-gate  }
137*0Sstevel@tonic-gate}
138*0Sstevel@tonic-gate
139*0Sstevel@tonic-gate{
140*0Sstevel@tonic-gate    print "not " unless charnames::viacode(0x1234) eq "ETHIOPIC SYLLABLE SEE";
141*0Sstevel@tonic-gate    print "ok 17\n";
142*0Sstevel@tonic-gate
143*0Sstevel@tonic-gate    # Unused Hebrew.
144*0Sstevel@tonic-gate    print "not " if defined charnames::viacode(0x0590);
145*0Sstevel@tonic-gate    print "ok 18\n";
146*0Sstevel@tonic-gate}
147*0Sstevel@tonic-gate
148*0Sstevel@tonic-gate{
149*0Sstevel@tonic-gate    print "not " unless
150*0Sstevel@tonic-gate	sprintf("%04X", charnames::vianame("GOTHIC LETTER AHSA")) eq "10330";
151*0Sstevel@tonic-gate    print "ok 19\n";
152*0Sstevel@tonic-gate
153*0Sstevel@tonic-gate    print "not " if
154*0Sstevel@tonic-gate	defined charnames::vianame("NONE SUCH");
155*0Sstevel@tonic-gate    print "ok 20\n";
156*0Sstevel@tonic-gate}
157*0Sstevel@tonic-gate
158*0Sstevel@tonic-gate{
159*0Sstevel@tonic-gate    # check that caching at least hasn't broken anything
160*0Sstevel@tonic-gate
161*0Sstevel@tonic-gate    print "not " unless charnames::viacode(0x1234) eq "ETHIOPIC SYLLABLE SEE";
162*0Sstevel@tonic-gate    print "ok 21\n";
163*0Sstevel@tonic-gate
164*0Sstevel@tonic-gate    print "not " unless
165*0Sstevel@tonic-gate	sprintf("%04X", charnames::vianame("GOTHIC LETTER AHSA")) eq "10330";
166*0Sstevel@tonic-gate    print "ok 22\n";
167*0Sstevel@tonic-gate
168*0Sstevel@tonic-gate}
169*0Sstevel@tonic-gate
170*0Sstevel@tonic-gateprint "not " unless "\N{CHARACTER TABULATION}" eq "\t";
171*0Sstevel@tonic-gateprint "ok 23\n";
172*0Sstevel@tonic-gate
173*0Sstevel@tonic-gateprint "not " unless "\N{ESCAPE}" eq "\e";
174*0Sstevel@tonic-gateprint "ok 24\n";
175*0Sstevel@tonic-gate
176*0Sstevel@tonic-gateprint "not " unless "\N{NULL}" eq "\c@";
177*0Sstevel@tonic-gateprint "ok 25\n";
178*0Sstevel@tonic-gate
179*0Sstevel@tonic-gateif ($^O eq 'MacOS')
180*0Sstevel@tonic-gate{
181*0Sstevel@tonic-gate	print "not " unless "\N{CARRIAGE RETURN (CR)}" eq "\n";
182*0Sstevel@tonic-gate	print "ok 26\n";
183*0Sstevel@tonic-gate
184*0Sstevel@tonic-gate	print "not " unless "\N{CARRIAGE RETURN}" eq "\n";
185*0Sstevel@tonic-gate	print "ok 27\n";
186*0Sstevel@tonic-gate
187*0Sstevel@tonic-gate	print "not " unless "\N{CR}" eq "\n";
188*0Sstevel@tonic-gate	print "ok 28\n";
189*0Sstevel@tonic-gate}
190*0Sstevel@tonic-gateelse
191*0Sstevel@tonic-gate{
192*0Sstevel@tonic-gate	print "not " unless "\N{LINE FEED (LF)}" eq "\n";
193*0Sstevel@tonic-gate	print "ok 26\n";
194*0Sstevel@tonic-gate
195*0Sstevel@tonic-gate	print "not " unless "\N{LINE FEED}" eq "\n";
196*0Sstevel@tonic-gate	print "ok 27\n";
197*0Sstevel@tonic-gate
198*0Sstevel@tonic-gate	print "not " unless "\N{LF}" eq "\n";
199*0Sstevel@tonic-gate	print "ok 28\n";
200*0Sstevel@tonic-gate}
201*0Sstevel@tonic-gate
202*0Sstevel@tonic-gatemy $nel = ord("A") == 193 ? qr/^(?:\x15|\x25)$/ : qr/^\x85$/;
203*0Sstevel@tonic-gate
204*0Sstevel@tonic-gateprint "not " unless "\N{NEXT LINE (NEL)}" =~ $nel;
205*0Sstevel@tonic-gateprint "ok 29\n";
206*0Sstevel@tonic-gate
207*0Sstevel@tonic-gateprint "not " unless "\N{NEXT LINE}" =~ $nel;
208*0Sstevel@tonic-gateprint "ok 30\n";
209*0Sstevel@tonic-gate
210*0Sstevel@tonic-gateprint "not " unless "\N{NEL}" =~ $nel;
211*0Sstevel@tonic-gateprint "ok 31\n";
212*0Sstevel@tonic-gate
213*0Sstevel@tonic-gateprint "not " unless "\N{BYTE ORDER MARK}" eq chr(0xFEFF);
214*0Sstevel@tonic-gateprint "ok 32\n";
215*0Sstevel@tonic-gate
216*0Sstevel@tonic-gateprint "not " unless "\N{BOM}" eq chr(0xFEFF);
217*0Sstevel@tonic-gateprint "ok 33\n";
218*0Sstevel@tonic-gate
219*0Sstevel@tonic-gate{
220*0Sstevel@tonic-gate    use warnings 'deprecated';
221*0Sstevel@tonic-gate
222*0Sstevel@tonic-gate    print "not " unless "\N{HORIZONTAL TABULATION}" eq "\t";
223*0Sstevel@tonic-gate    print "ok 34\n";
224*0Sstevel@tonic-gate
225*0Sstevel@tonic-gate    print "not " unless grep { /"HORIZONTAL TABULATION" is deprecated/ } @WARN;
226*0Sstevel@tonic-gate    print "ok 35\n";
227*0Sstevel@tonic-gate
228*0Sstevel@tonic-gate    no warnings 'deprecated';
229*0Sstevel@tonic-gate
230*0Sstevel@tonic-gate    print "not " unless "\N{VERTICAL TABULATION}" eq "\013";
231*0Sstevel@tonic-gate    print "ok 36\n";
232*0Sstevel@tonic-gate
233*0Sstevel@tonic-gate    print "not " if grep { /"VERTICAL TABULATION" is deprecated/ } @WARN;
234*0Sstevel@tonic-gate    print "ok 37\n";
235*0Sstevel@tonic-gate}
236*0Sstevel@tonic-gate
237*0Sstevel@tonic-gateprint "not " unless charnames::viacode(0xFEFF) eq "ZERO WIDTH NO-BREAK SPACE";
238*0Sstevel@tonic-gateprint "ok 38\n";
239*0Sstevel@tonic-gate
240*0Sstevel@tonic-gate{
241*0Sstevel@tonic-gate    use warnings;
242*0Sstevel@tonic-gate    print "not " unless ord("\N{BOM}") == 0xFEFF;
243*0Sstevel@tonic-gate    print "ok 39\n";
244*0Sstevel@tonic-gate}
245*0Sstevel@tonic-gate
246*0Sstevel@tonic-gateprint "not " unless ord("\N{ZWNJ}") == 0x200C;
247*0Sstevel@tonic-gateprint "ok 40\n";
248*0Sstevel@tonic-gate
249*0Sstevel@tonic-gateprint "not " unless ord("\N{ZWJ}") == 0x200D;
250*0Sstevel@tonic-gateprint "ok 41\n";
251*0Sstevel@tonic-gate
252*0Sstevel@tonic-gateprint "not " unless "\N{U+263A}" eq "\N{WHITE SMILING FACE}";
253*0Sstevel@tonic-gateprint "ok 42\n";
254*0Sstevel@tonic-gate
255*0Sstevel@tonic-gate{
256*0Sstevel@tonic-gate    print "not " unless
257*0Sstevel@tonic-gate	0x3093 == charnames::vianame("HIRAGANA LETTER N");
258*0Sstevel@tonic-gate    print "ok 43\n";
259*0Sstevel@tonic-gate
260*0Sstevel@tonic-gate    print "not " unless
261*0Sstevel@tonic-gate	0x0397 == charnames::vianame("GREEK CAPITAL LETTER ETA");
262*0Sstevel@tonic-gate    print "ok 44\n";
263*0Sstevel@tonic-gate}
264*0Sstevel@tonic-gate
265*0Sstevel@tonic-gateprint "not " if defined charnames::viacode(0x110000);
266*0Sstevel@tonic-gateprint "ok 45\n";
267*0Sstevel@tonic-gate
268*0Sstevel@tonic-gateprint "not " if grep { /you asked for U+110000/ } @WARN;
269*0Sstevel@tonic-gateprint "ok 46\n";
270*0Sstevel@tonic-gate
271*0Sstevel@tonic-gate
272*0Sstevel@tonic-gate# ---- Alias extensions
273*0Sstevel@tonic-gate
274*0Sstevel@tonic-gatemy $tmpfile = "tmp0000";
275*0Sstevel@tonic-gatemy $alifile = File::Spec->catfile(File::Spec->updir, qw(lib unicore xyzzy_alias.pl));
276*0Sstevel@tonic-gatemy $i = 0;
277*0Sstevel@tonic-gate1 while -e ++$tmpfile;
278*0Sstevel@tonic-gateEND { if ($tmpfile) { 1 while unlink $tmpfile; } }
279*0Sstevel@tonic-gate
280*0Sstevel@tonic-gatemy @prgs;
281*0Sstevel@tonic-gate{   local $/ = undef;
282*0Sstevel@tonic-gate    @prgs = split "\n########\n", <DATA>;
283*0Sstevel@tonic-gate    }
284*0Sstevel@tonic-gate
285*0Sstevel@tonic-gatemy $i = 46;
286*0Sstevel@tonic-gatefor (@prgs) {
287*0Sstevel@tonic-gate    my ($code, $exp) = ((split m/\nEXPECT\n/), '$');
288*0Sstevel@tonic-gate    my ($prog, $fil) = ((split m/\nFILE\n/, $code), "");
289*0Sstevel@tonic-gate    open my $tmp, "> $tmpfile" or die "Could not open $tmpfile: $!";
290*0Sstevel@tonic-gate    print $tmp $prog, "\n";
291*0Sstevel@tonic-gate    close $tmp or die "Could not close $tmpfile: $!";
292*0Sstevel@tonic-gate    if ($fil) {
293*0Sstevel@tonic-gate	$fil .= "\n";
294*0Sstevel@tonic-gate	open my $ali, "> $alifile" or die "Could not open $alifile: $!";
295*0Sstevel@tonic-gate	print $ali $fil;
296*0Sstevel@tonic-gate	close $ali or die "Could not close $alifile: $!";
297*0Sstevel@tonic-gate	}
298*0Sstevel@tonic-gate    my $res = runperl( switches => $switch,
299*0Sstevel@tonic-gate                       progfile => $tmpfile,
300*0Sstevel@tonic-gate                       stderr => 1 );
301*0Sstevel@tonic-gate    my $status = $?;
302*0Sstevel@tonic-gate    $res =~ s/[\r\n]+$//;
303*0Sstevel@tonic-gate    $res =~ s/tmp\d+/-/g;			# fake $prog from STDIN
304*0Sstevel@tonic-gate    $res =~ s/\n%[A-Z]+-[SIWEF]-.*$//		# clip off DCL status msg
305*0Sstevel@tonic-gate	if $^O eq "VMS";
306*0Sstevel@tonic-gate    $exp =~ s/[\r\n]+$//;
307*0Sstevel@tonic-gate    if ($^O eq "MacOS") {
308*0Sstevel@tonic-gate	$exp =~ s{(\./)?abc\.pm}{:abc.pm}g;
309*0Sstevel@tonic-gate	$exp =~ s{./abc}        {:abc}g;
310*0Sstevel@tonic-gate	}
311*0Sstevel@tonic-gate    my $pfx = ($res =~ s/^PREFIX\n//);
312*0Sstevel@tonic-gate    my $rexp = qr{^$exp};
313*0Sstevel@tonic-gate    if ($res =~ s/^SKIPPED\n//) {
314*0Sstevel@tonic-gate	print "$results\n";
315*0Sstevel@tonic-gate	}
316*0Sstevel@tonic-gate    elsif (($pfx and $res !~ /^\Q$expected/) or
317*0Sstevel@tonic-gate	  (!$pfx and $res !~ $rexp)) {
318*0Sstevel@tonic-gate        print STDERR
319*0Sstevel@tonic-gate	    "PROG:\n$prog\n",
320*0Sstevel@tonic-gate	    "FILE:\n$fil",
321*0Sstevel@tonic-gate	    "EXPECTED:\n$exp\n",
322*0Sstevel@tonic-gate	    "GOT:\n$res\n";
323*0Sstevel@tonic-gate        print "not ";
324*0Sstevel@tonic-gate	}
325*0Sstevel@tonic-gate    print "ok ", ++$i, "\n";
326*0Sstevel@tonic-gate    1 while unlink $tmpfile;
327*0Sstevel@tonic-gate    $fil or next;
328*0Sstevel@tonic-gate    1 while unlink $alifile;
329*0Sstevel@tonic-gate    }
330*0Sstevel@tonic-gate
331*0Sstevel@tonic-gate__END__
332*0Sstevel@tonic-gate# unsupported pragma
333*0Sstevel@tonic-gateuse charnames ":scoobydoo";
334*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
335*0Sstevel@tonic-gateEXPECT
336*0Sstevel@tonic-gateunsupported special ':scoobydoo' in charnames at
337*0Sstevel@tonic-gate########
338*0Sstevel@tonic-gate# wrong type of alias (missing colon)
339*0Sstevel@tonic-gateuse charnames "alias";
340*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
341*0Sstevel@tonic-gateEXPECT
342*0Sstevel@tonic-gateUnknown charname 'e_ACUTE' at
343*0Sstevel@tonic-gate########
344*0Sstevel@tonic-gate# alias without an argument
345*0Sstevel@tonic-gateuse charnames ":alias";
346*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
347*0Sstevel@tonic-gateEXPECT
348*0Sstevel@tonic-gate:alias needs an argument in charnames at
349*0Sstevel@tonic-gate########
350*0Sstevel@tonic-gate# reversed sequence
351*0Sstevel@tonic-gateuse charnames ":alias" => ":full";
352*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
353*0Sstevel@tonic-gateEXPECT
354*0Sstevel@tonic-gate:alias cannot use existing pragma :full \(reversed order\?\) at
355*0Sstevel@tonic-gate########
356*0Sstevel@tonic-gate# alias with hashref but no :full
357*0Sstevel@tonic-gateuse charnames ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE" };
358*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
359*0Sstevel@tonic-gateEXPECT
360*0Sstevel@tonic-gateUnknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
361*0Sstevel@tonic-gate########
362*0Sstevel@tonic-gate# alias with hashref but with :short
363*0Sstevel@tonic-gateuse charnames ":short", ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE" };
364*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
365*0Sstevel@tonic-gateEXPECT
366*0Sstevel@tonic-gateUnknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
367*0Sstevel@tonic-gate########
368*0Sstevel@tonic-gate# alias with hashref to :full OK
369*0Sstevel@tonic-gateuse charnames ":full", ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE" };
370*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
371*0Sstevel@tonic-gateEXPECT
372*0Sstevel@tonic-gate$
373*0Sstevel@tonic-gate########
374*0Sstevel@tonic-gate# alias with hashref to :short but using :full
375*0Sstevel@tonic-gateuse charnames ":full", ":alias" => { e_ACUTE => "LATIN:e WITH ACUTE" };
376*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
377*0Sstevel@tonic-gateEXPECT
378*0Sstevel@tonic-gateUnknown charname 'LATIN:e WITH ACUTE' at
379*0Sstevel@tonic-gate########
380*0Sstevel@tonic-gate# alias with hashref to :short OK
381*0Sstevel@tonic-gateuse charnames ":short", ":alias" => { e_ACUTE => "LATIN:e WITH ACUTE" };
382*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
383*0Sstevel@tonic-gateEXPECT
384*0Sstevel@tonic-gate$
385*0Sstevel@tonic-gate########
386*0Sstevel@tonic-gate# alias with bad hashref
387*0Sstevel@tonic-gateuse charnames ":short", ":alias" => "e_ACUTE";
388*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
389*0Sstevel@tonic-gateEXPECT
390*0Sstevel@tonic-gateunicore/e_ACUTE_alias.pl cannot be used as alias file for charnames at
391*0Sstevel@tonic-gate########
392*0Sstevel@tonic-gate# alias with arrayref
393*0Sstevel@tonic-gateuse charnames ":short", ":alias" => [ e_ACUTE => "LATIN:e WITH ACUTE" ];
394*0Sstevel@tonic-gate"Here: \N{e_ACUTE}!\n";
395*0Sstevel@tonic-gateEXPECT
396*0Sstevel@tonic-gateOnly HASH reference supported as argument to :alias at
397*0Sstevel@tonic-gate########
398*0Sstevel@tonic-gate# alias with bad hashref
399*0Sstevel@tonic-gateuse charnames ":short", ":alias" => { e_ACUTE => "LATIN:e WITH ACUTE", "a_ACUTE" };
400*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
401*0Sstevel@tonic-gateEXPECT
402*0Sstevel@tonic-gateUse of uninitialized value in string eq at
403*0Sstevel@tonic-gate########
404*0Sstevel@tonic-gate# alias with hashref two aliases
405*0Sstevel@tonic-gateuse charnames ":short", ":alias" => {
406*0Sstevel@tonic-gate    e_ACUTE => "LATIN:e WITH ACUTE",
407*0Sstevel@tonic-gate    a_ACUTE => "",
408*0Sstevel@tonic-gate    };
409*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
410*0Sstevel@tonic-gateEXPECT
411*0Sstevel@tonic-gateUnknown charname '' at
412*0Sstevel@tonic-gate########
413*0Sstevel@tonic-gate# alias with hashref two aliases
414*0Sstevel@tonic-gateuse charnames ":short", ":alias" => {
415*0Sstevel@tonic-gate    e_ACUTE => "LATIN:e WITH ACUTE",
416*0Sstevel@tonic-gate    a_ACUTE => "LATIN:a WITH ACUTE",
417*0Sstevel@tonic-gate    };
418*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
419*0Sstevel@tonic-gateEXPECT
420*0Sstevel@tonic-gate$
421*0Sstevel@tonic-gate########
422*0Sstevel@tonic-gate# alias with hashref using mixed aliasses
423*0Sstevel@tonic-gateuse charnames ":short", ":alias" => {
424*0Sstevel@tonic-gate    e_ACUTE => "LATIN:e WITH ACUTE",
425*0Sstevel@tonic-gate    a_ACUTE => "LATIN SMALL LETTER A WITH ACUT",
426*0Sstevel@tonic-gate    };
427*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
428*0Sstevel@tonic-gateEXPECT
429*0Sstevel@tonic-gateUnknown charname 'LATIN SMALL LETTER A WITH ACUT' at
430*0Sstevel@tonic-gate########
431*0Sstevel@tonic-gate# alias with hashref using mixed aliasses
432*0Sstevel@tonic-gateuse charnames ":short", ":alias" => {
433*0Sstevel@tonic-gate    e_ACUTE => "LATIN:e WITH ACUTE",
434*0Sstevel@tonic-gate    a_ACUTE => "LATIN SMALL LETTER A WITH ACUTE",
435*0Sstevel@tonic-gate    };
436*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
437*0Sstevel@tonic-gateEXPECT
438*0Sstevel@tonic-gateUnknown charname 'LATIN SMALL LETTER A WITH ACUTE' at
439*0Sstevel@tonic-gate########
440*0Sstevel@tonic-gate# alias with hashref using mixed aliasses
441*0Sstevel@tonic-gateuse charnames ":full", ":alias" => {
442*0Sstevel@tonic-gate    e_ACUTE => "LATIN:e WITH ACUTE",
443*0Sstevel@tonic-gate    a_ACUTE => "LATIN SMALL LETTER A WITH ACUTE",
444*0Sstevel@tonic-gate    };
445*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
446*0Sstevel@tonic-gateEXPECT
447*0Sstevel@tonic-gateUnknown charname 'LATIN:e WITH ACUTE' at
448*0Sstevel@tonic-gate########
449*0Sstevel@tonic-gate# alias with nonexisting file
450*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "xyzzy";
451*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
452*0Sstevel@tonic-gateEXPECT
453*0Sstevel@tonic-gateunicore/xyzzy_alias.pl cannot be used as alias file for charnames at
454*0Sstevel@tonic-gate########
455*0Sstevel@tonic-gate# alias with bad file name
456*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "xy 7-";
457*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
458*0Sstevel@tonic-gateEXPECT
459*0Sstevel@tonic-gateCharnames alias files can only have identifier characters at
460*0Sstevel@tonic-gate########
461*0Sstevel@tonic-gate# alias with non_absolute (existing) file name (which it should /not/ use)
462*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "perl";
463*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
464*0Sstevel@tonic-gateEXPECT
465*0Sstevel@tonic-gateunicore/perl_alias.pl cannot be used as alias file for charnames at
466*0Sstevel@tonic-gate########
467*0Sstevel@tonic-gate# alias with bad file
468*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "xyzzy";
469*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
470*0Sstevel@tonic-gateFILE
471*0Sstevel@tonic-gate#!perl
472*0Sstevel@tonic-gate0;
473*0Sstevel@tonic-gateEXPECT
474*0Sstevel@tonic-gateunicore/xyzzy_alias.pl did not return a \(valid\) list of alias pairs at
475*0Sstevel@tonic-gate########
476*0Sstevel@tonic-gate# alias with file with empty list
477*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "xyzzy";
478*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
479*0Sstevel@tonic-gateFILE
480*0Sstevel@tonic-gate#!perl
481*0Sstevel@tonic-gate();
482*0Sstevel@tonic-gateEXPECT
483*0Sstevel@tonic-gateUnknown charname 'e_ACUTE' at
484*0Sstevel@tonic-gate########
485*0Sstevel@tonic-gate# alias with file OK but file has :short aliasses
486*0Sstevel@tonic-gateuse charnames ":full", ":alias" => "xyzzy";
487*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
488*0Sstevel@tonic-gateFILE
489*0Sstevel@tonic-gate#!perl
490*0Sstevel@tonic-gate(   e_ACUTE => "LATIN:e WITH ACUTE",
491*0Sstevel@tonic-gate    a_ACUTE => "LATIN:a WITH ACUTE",
492*0Sstevel@tonic-gate    );
493*0Sstevel@tonic-gateEXPECT
494*0Sstevel@tonic-gateUnknown charname 'LATIN:e WITH ACUTE' at
495*0Sstevel@tonic-gate########
496*0Sstevel@tonic-gate# alias with :short and file OK
497*0Sstevel@tonic-gateuse charnames ":short", ":alias" => "xyzzy";
498*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
499*0Sstevel@tonic-gateFILE
500*0Sstevel@tonic-gate#!perl
501*0Sstevel@tonic-gate(   e_ACUTE => "LATIN:e WITH ACUTE",
502*0Sstevel@tonic-gate    a_ACUTE => "LATIN:a WITH ACUTE",
503*0Sstevel@tonic-gate    );
504*0Sstevel@tonic-gateEXPECT
505*0Sstevel@tonic-gate$
506*0Sstevel@tonic-gate########
507*0Sstevel@tonic-gate# alias with :short and file OK has :long aliasses
508*0Sstevel@tonic-gateuse charnames ":short", ":alias" => "xyzzy";
509*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
510*0Sstevel@tonic-gateFILE
511*0Sstevel@tonic-gate#!perl
512*0Sstevel@tonic-gate(   e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE",
513*0Sstevel@tonic-gate    a_ACUTE => "LATIN SMALL LETTER A WITH ACUTE",
514*0Sstevel@tonic-gate    );
515*0Sstevel@tonic-gateEXPECT
516*0Sstevel@tonic-gateUnknown charname 'LATIN SMALL LETTER E WITH ACUTE' at
517*0Sstevel@tonic-gate########
518*0Sstevel@tonic-gate# alias with file implicit :full but file has :short aliasses
519*0Sstevel@tonic-gateuse charnames ":alias" => ":xyzzy";
520*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
521*0Sstevel@tonic-gateFILE
522*0Sstevel@tonic-gate#!perl
523*0Sstevel@tonic-gate(   e_ACUTE => "LATIN:e WITH ACUTE",
524*0Sstevel@tonic-gate    a_ACUTE => "LATIN:a WITH ACUTE",
525*0Sstevel@tonic-gate    );
526*0Sstevel@tonic-gateEXPECT
527*0Sstevel@tonic-gateUnknown charname 'LATIN:e WITH ACUTE' at
528*0Sstevel@tonic-gate########
529*0Sstevel@tonic-gate# alias with file implicit :full and file has :long aliasses
530*0Sstevel@tonic-gateuse charnames ":alias" => ":xyzzy";
531*0Sstevel@tonic-gate"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
532*0Sstevel@tonic-gateFILE
533*0Sstevel@tonic-gate#!perl
534*0Sstevel@tonic-gate(   e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE",
535*0Sstevel@tonic-gate    a_ACUTE => "LATIN SMALL LETTER A WITH ACUTE",
536*0Sstevel@tonic-gate    );
537*0Sstevel@tonic-gateEXPECT
538*0Sstevel@tonic-gate$
539