3 use Test::More tests => 5;
9 $b = "\303\244"; # or encode_utf8("\x{e4}");
11 is(XS::APItest::first_byte($b), 0303,
12 "test function first_byte works");
15 is(XS::APItest::first_byte($1), 0303,
16 "matching works correctly");
18 $a = qq[\x{263a}]; # utf8 flag is set
20 $a =~ s/(.)/$1/; # $1 now has the utf8 flag set too
21 $b =~ /(.)/; # $1 shouldn't have the utf8 flag anymore
23 is(XS::APItest::first_byte("$1"), 0303,
24 "utf8 flag in match fetched correctly when stringified first");
26 $a =~ s/(.)/$1/; # $1 now has the utf8 flag set too
27 $b =~ /(.)/; # $1 shouldn't have the utf8 flag anymore
29 is(eval { XS::APItest::first_byte($1) } || $@, 0303,
30 "utf8 flag fetched correctly without stringification");