diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-07-05 07:00:02 -0300 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:01 -0700 |
commit | 04f3bf56223811033be1a499c8cee8d78d256dea (patch) | |
tree | 936b999010fabbf718c4c62a467abb2f612e5433 /ext | |
parent | bc1c56e9ff3236b7b36e9c6b40be78049dc44505 (diff) | |
download | perl-04f3bf56223811033be1a499c8cee8d78d256dea.tar.gz |
gv.c: gv_name_set and gv_init_(etc) now initialize the GV's name as UTF-8 if passed the UTF8 flag.
newCONSTSUB is still unclean however, so constant subs are
still generated under a wrong name.
gv_fullname4 is also UTF-8 aware now; While that should've gotten
it's own commit and tests, it's not possible to test the
UTF-8 part without the gv_init changes, and it's not possible
to test the gv_init changes without gv_fullname4.
Chicken and egg, as it were. So let's compromise and
wait for the relevant tests once globs can be intiialized as
UTF-8 from the Perl level without XS magic.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/XS-APItest/t/gv_init.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/XS-APItest/t/gv_init.t b/ext/XS-APItest/t/gv_init.t index fee41f6cbc..23d4aa595e 100644 --- a/ext/XS-APItest/t/gv_init.t +++ b/ext/XS-APItest/t/gv_init.t @@ -2,14 +2,20 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 12; use XS::APItest; -is my $glob = XS::APItest::gv_init_type("sanity_check", 0, 0, 0), "*main::sanity_check"; +is XS::APItest::gv_init_type("sanity_check", 0, 0, 0), "*main::sanity_check"; ok $::{sanity_check}; for my $type (0..3) { - is my $glob = XS::APItest::gv_init_type("test$type", 0, 0, $type), "*main::test$type"; + 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"; |