This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gv.c: gv_name_set and gv_init_(etc) now initialize the GV's name as UTF-8 if passed...
[perl5.git] / ext / XS-APItest / t / gv_init.t
1 #!perl
2
3 use strict;
4 use warnings;
5 use Test::More tests => 12;
6
7 use XS::APItest;
8
9 is XS::APItest::gv_init_type("sanity_check", 0, 0, 0), "*main::sanity_check";
10 ok $::{sanity_check};
11
12 for my $type (0..3) {
13     is XS::APItest::gv_init_type("test$type", 0, 0, $type), "*main::test$type";
14     ok $::{"test$type"};
15 }
16
17 my $latin_1 = "รจ";
18 my $utf8    = "\x{30cb}";
19
20 is XS::APItest::gv_init_type($latin_1, 0, 0, 1), "*main::$latin_1";
21 is XS::APItest::gv_init_type($utf8, 0, 0, 1), "*main::$utf8";