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