This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
netbsd-vax: customized.dat update for S-L-U
[perl5.git] / t / uni / eval.t
1 #!./perl
2
3 # Check if eval correctly ignores the UTF-8 hint.
4
5 BEGIN {
6     chdir 't' if -d 't';
7     require './test.pl';
8 }
9
10 plan (tests => 5);
11
12 use open qw( :utf8 :std );
13 use feature 'unicode_eval';
14
15 {
16     my $w;
17     $SIG{__WARN__} = sub { $w = shift };
18     use utf8;
19     my $prog = "qq!\x{f9}!";
20
21     eval $prog;
22     ok !$w;
23
24     $w = "";
25     utf8::upgrade($prog);
26     eval $prog;
27     is $w, '';
28 }
29
30 {
31     use utf8;
32     isnt eval "q!\360\237\220\252!", eval "q!\x{1f42a}!";
33 }
34
35 {
36     no utf8; #Let's make real sure.
37     my $not_utf8 = "q!\343\203\213!";
38     isnt eval $not_utf8, eval "q!\x{30cb}!";
39     {
40         use utf8;
41         isnt eval $not_utf8, eval "q!\x{30cb}!";
42     }
43 }