summaryrefslogtreecommitdiff
path: root/ext/XS-APItest/t/gv_init.t
blob: 23d4aa595e86cb64a6d96bf4a915b69ad6bca8bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl

use strict;
use warnings;
use Test::More tests => 12;

use XS::APItest;

is XS::APItest::gv_init_type("sanity_check", 0, 0, 0), "*main::sanity_check";
ok $::{sanity_check};

for my $type (0..3) {
    is XS::APItest::gv_init_type("test$type", 0, 0, $type), "*main::test$type";
    ok $::{"test$type"};
}

my $latin_1 = "รจ";
my $utf8    = "\x{30cb}";

is XS::APItest::gv_init_type($latin_1, 0, 0, 1), "*main::$latin_1";
is XS::APItest::gv_init_type($utf8, 0, 0, 1), "*main::$utf8";