3 # Checks if 'package' work as intended.
13 use open qw( :utf8 :std );
21 ok 1, "sanity check. If we got this far, UTF-8 in package names is legal.";
23 #The next few come from comp/package.t
41 $ꑭʑ = join(':', sort(keys %ꑭʑ::));
42 $압Ƈ = join(':', sort(keys %압Ƈ::));
44 ::is $ꑭʑ, 'bar:ニュー:ꑭʑ:압Ƈ', "comp/stash.t test 1";
45 ::is $압Ƈ, "d읯ⱪ:ㄅĽuṞfⳐ", "comp/stash.t test 2";
46 ::is $main'ㄅĽuṞfⳐ, 123, "comp/stash.t test 3";
50 ::is $ㄅĽuṞfⳐ, 5, "comp/stash.t test 4";
51 eval '::is $ㄅĽuṞfⳐ, 5, "comp/stash.t test 5";';
52 eval 'package main; is $ㄅĽuṞfⳐ, 123, "comp/stash.t test 6";';
53 ::is $ㄅĽuṞfⳐ, 5, "comp/stash.t test 7";
55 #This is actually pretty bad, as caller() wasn't clean to begin with.
67 is((ƒஓ(1))[0], 'ᛔQR', "comp/stash.t test 8");
71 eval { $a = *ꑭʑ::ニュー{PACKAGE}; };
72 is $a, "__ANON__", "comp/stash.t test 9";
77 like $@, qr/^Can't use anonymous symbol table for method lookup/, "comp/stash.t test 10";
80 like "$Q", qr/^__ANON__=/, "comp/stash.t test 11";
82 is ref $Q, "__ANON__", "comp/stash.t test 12";
84 package bugⅲⅱⅴⅵⅱ { #not really latin, but bear with me, I'm not Damian.
85 ::is( __PACKAGE__, 'bugⅲⅱⅴⅵⅱ', "comp/stash.t test 13");
86 ::is( eval('__PACKAGE__'), 'bugⅲⅱⅴⅵⅱ', "comp/stash.t test 14");
90 #This comes from comp/package_block.t
94 like $@, qr/\AMissing right curly /, "comp/package_block.t test";
100 my $latin_1 = "þackage";
101 my $utf8 = "þackage";
102 utf8::downgrade($latin_1);
103 utf8::upgrade($utf8);
106 eval { $latin_1->can("yadda") };
107 ok(!$@, "latin1->meth works");
110 eval { $utf8->can("yadda") };
111 ok(!$@, "utf8->meth works");