From: Jesse Luehrs Date: Tue, 29 Nov 2011 09:13:42 +0000 (-0600) Subject: make sure this is testing the right thing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1715486bd682c4bd12ac1995ef26db5a76fed5e8;p=gitmo%2FPackage-Stash.git make sure this is testing the right thing --- diff --git a/t/basic.t b/t/basic.t index ded3d77..b0f9936 100644 --- a/t/basic.t +++ b/t/basic.t @@ -251,9 +251,13 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f } { - $foo_stash->add_symbol('%zork'); - ok(!$foo_stash->has_symbol('$zork'), + $foo_stash->add_symbol('%bare'); + ok(!$foo_stash->has_symbol('$bare'), "add_symbol with single argument doesn't vivify scalar slot"); +} + +{ + $foo_stash->add_symbol('%zork', {}); my $syms = $foo_stash->get_all_symbols('HASH'); @@ -267,10 +271,9 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f is($syms->{$symbol}, $foo_stash->get_symbol('%' . $symbol), '... got the right symbol'); } - no warnings 'once'; is_deeply( $syms, - { zork => \%Foo::zork }, + { zork => *{ $Foo::{zork} }{HASH} }, "got the right ones", ); } diff --git a/t/impl-selection/basic-pp.t b/t/impl-selection/basic-pp.t index 086368e..5c80d09 100644 --- a/t/impl-selection/basic-pp.t +++ b/t/impl-selection/basic-pp.t @@ -255,9 +255,13 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f } { - $foo_stash->add_symbol('%zork'); - ok(!$foo_stash->has_symbol('$zork'), + $foo_stash->add_symbol('%bare'); + ok(!$foo_stash->has_symbol('$bare'), "add_symbol with single argument doesn't vivify scalar slot"); +} + +{ + $foo_stash->add_symbol('%zork', {}); my $syms = $foo_stash->get_all_symbols('HASH'); @@ -271,10 +275,9 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f is($syms->{$symbol}, $foo_stash->get_symbol('%' . $symbol), '... got the right symbol'); } - no warnings 'once'; is_deeply( $syms, - { zork => \%Foo::zork }, + { zork => *{ $Foo::{zork} }{HASH} }, "got the right ones", ); } diff --git a/t/impl-selection/basic-xs.t b/t/impl-selection/basic-xs.t index 8a1b40b..cb46953 100644 --- a/t/impl-selection/basic-xs.t +++ b/t/impl-selection/basic-xs.t @@ -256,9 +256,13 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f } { - $foo_stash->add_symbol('%zork'); - ok(!$foo_stash->has_symbol('$zork'), + $foo_stash->add_symbol('%bare'); + ok(!$foo_stash->has_symbol('$bare'), "add_symbol with single argument doesn't vivify scalar slot"); +} + +{ + $foo_stash->add_symbol('%zork', {}); my $syms = $foo_stash->get_all_symbols('HASH'); @@ -272,10 +276,9 @@ is($foo_stash->get_symbol('@foo'), $ARRAY, '... got the right values for @Foo::f is($syms->{$symbol}, $foo_stash->get_symbol('%' . $symbol), '... got the right symbol'); } - no warnings 'once'; is_deeply( $syms, - { zork => \%Foo::zork }, + { zork => *{ $Foo::{zork} }{HASH} }, "got the right ones", ); }