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";
59 my $prog = "redo L\N{LATIN CAPITAL LETTER A WITH ACUTE}BEL";
62 utf8::downgrade($prog);
65 no warnings 'exiting';
70 is $@, '', "redo to downgradeable labels works";
71 is $d, -1, "Latin-1 labels reachable regardless of UTF-8ness";
79 pass("goto UTF-8 LABEL works.");