3 # Tests for labels in UTF-8
12 use open qw( :utf8 :std );
14 use feature qw 'unicode_strings evalbytes';
16 use charnames qw( :full );
21 pass("Sanity check, UTF-8 labels don't throw a syntax error.");
26 skip_if_miniperl("no dynamic loading, no Encode", 2);
27 no warnings 'exiting';
30 my $prog = 'last LOOP;';
35 is $@, '', "last with a UTF-8 label works,";
38 Encode::_utf8_off($prog);
40 like $@, qr/^Unrecognized character/, "..but turn off the UTF-8 flag and it explodes";
45 no warnings 'exiting';
48 like $@, qr/Label not found for "last E" at/u, "last's error is UTF-8 clean";
51 like $@, qr/Label not found for "redo E" at/u, "redo's error is UTF-8 clean";
54 like $@, qr/Label not found for "next E" at/u, "next's error is UTF-8 clean";
60 my $prog = "redo L\N{LATIN CAPITAL LETTER A WITH ACUTE}BEL";
63 is $e, '', "redo UTF8 works";
64 utf8::downgrade($prog);
67 use feature 'unicode_eval';
68 no warnings 'exiting';
73 like $@, qr/Unrecognized character/, "redo to downgradeable labels";
74 is $d, 0, "Latin-1 labels are reachable";
82 pass("goto UTF-8 LABEL works.");