# various typeglob tests
#
-print "1..30\n";
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+use warnings;
+
+print "1..40\n";
# type coersion on assignment
$foo = 'foo';
# fact that %X::Y:: is stored in %X:: isn't documented.
# (I hope.)
-{ package Foo::Bar; $test=1; }
+{ package Foo::Bar; no warnings 'once'; $test=1; }
print exists $Foo::{'Bar::'} ? "ok 12\n" : "not ok 12\n";
print $Foo::{'Bar::'} eq '*Foo::Bar::' ? "ok 13\n" : "not ok 13\n";
{
my $msg;
local $SIG{__WARN__} = sub { $msg = $_[0] };
- local $^W = 1;
+ use warnings;
*foo = 'bar';
print $msg ? "not ok" : "ok", " 15\n";
*foo = undef;
++$test; &{$a};
}
+# although it *should* if you're talking about magicals
+
+{
+ my $test = 29;
+
+ my $a = "]";
+ print "not " unless defined ${$a};
+ ++$test; print "ok $test\n";
+ print "not " unless defined *{$a};
+ ++$test; print "ok $test\n";
+
+ $a = "1";
+ "o" =~ /(o)/;
+ print "not " unless ${$a};
+ ++$test; print "ok $test\n";
+ print "not " unless defined *{$a};
+ ++$test; print "ok $test\n";
+ $a = "2";
+ print "not " if ${$a};
+ ++$test; print "ok $test\n";
+ print "not " unless defined *{$a};
+ ++$test; print "ok $test\n";
+ $a = "1x";
+ print "not " if defined ${$a};
+ ++$test; print "ok $test\n";
+ print "not " if defined *{$a};
+ ++$test; print "ok $test\n";
+ $a = "11";
+ "o" =~ /(((((((((((o)))))))))))/;
+ print "not " unless ${$a};
+ ++$test; print "ok $test\n";
+ print "not " unless defined *{$a};
+ ++$test; print "ok $test\n";
+}
+
+
# does pp_readline() handle glob-ness correctly?
{
}
__END__
-ok 30
+ok 40