diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-04-05 22:16:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-04-05 22:16:04 -0500 |
commit | 43a3a6d662f97d039fe9d02ddf10b89bfc6fd16e (patch) | |
tree | caf5fe84f19aa71807582f2bce3779178130b5dc /t/basic.t | |
parent | 728e904fa63ff6fe503e21eba35f1e8c04c57591 (diff) | |
download | class-refresh-43a3a6d662f97d039fe9d02ddf10b89bfc6fd16e.tar.gz class-refresh-43a3a6d662f97d039fe9d02ddf10b89bfc6fd16e.zip |
test for changing global variables too
Diffstat (limited to 't/basic.t')
-rw-r--r-- | t/basic.t | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -16,6 +16,9 @@ Class::Refresh->refresh; can_ok('Foo', 'meth'); ok(!Foo->can('other_meth'), "!Foo->can('other_meth')"); +is($Foo::FOO, 1, "package global exists"); +is($Foo::BAR, 2, "other package global exists"); +ok(!defined($Foo::BAZ), "third package global doesn't exist"); sleep 2; @@ -25,5 +28,13 @@ Class::Refresh->refresh; can_ok('Foo', 'other_meth'); ok(!Foo->can('meth'), "!Foo->can('meth')"); +{ local $TODO = "hrm, global access like this is resolved at compile time"; +is($Foo::FOO, 10, "package global exists with new value"); +ok(!defined($Foo::BAR), "other package global doesn't exist"); +is($Foo::BAZ, 30, "third package global exists"); +} +is(eval '$Foo::FOO', 10, "package global exists with new value"); +ok(!defined(eval '$Foo::BAR'), "other package global doesn't exist"); +is(eval '$Foo::BAZ', 30, "third package global exists"); done_testing; |