summaryrefslogtreecommitdiff
path: root/t/pragma/warn/utf8
blob: cb1f202b8d8431c7d19a9e1aa01efc00b43ddf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

  utf8.c AOK

     [utf8_to_uv]
     Malformed UTF-8 character
	my $a = ord "\x80" ;

     Malformed UTF-8 character
	my $a = ord "\xf080" ;
     <<<<<< this warning can't be easily triggered from perl anymore

     [utf16_to_utf8]
     Malformed UTF-16 surrogate		
     <<<<<< Add a test when somethig actually calls utf16_to_utf8

__END__
# utf8.c [utf8_to_uv]
use utf8 ;
my $a = ord "\x80" ;
EXPECT
########
# utf8.c [utf8_to_uv]
BEGIN {
    if (ord("\t") == 5) {
        print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
        exit 0;
    }
}
use utf8 ;
my $a = ord "\x80" ;
{
    use warnings 'utf8' ;
    my $a = ord "\x80" ;
    no warnings 'utf8' ;
    my $a = ord "\x80" ;
}
EXPECT
\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 12.
########
# utf8.c [utf8_to_uv]
use utf8 ;
my $a = ord "\xf080" ;
EXPECT
########
# utf8.c [utf8_to_uv]
BEGIN {
    if (ord("\t") == 5) {
        print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
        exit 0;
    }
}
use utf8 ;
my $a = ord "\xf080" ;
{
    use warnings 'utf8' ;
    my $a = ord "\xf080" ;
    no warnings 'utf8' ;
    my $a = ord "\xf080" ;
}
EXPECT
\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 12.