remove some unnecessary casts
[gitmo/Package-Stash-XS.git] / t / 02-extension.t
index 1ac20c0..0136b1a 100644 (file)
@@ -23,7 +23,7 @@ use Test::Fatal;
     sub add_package_symbol {
         my ($self, $variable, $initial_value) = @_;
 
-        my ($name, $sigil, $type) = $self->_deconstruct_variable_name($variable);
+        (my $name = $variable) =~ s/^[\$\@\%\&]//;
 
         my $glob = gensym();
         *{$glob} = $initial_value if defined $initial_value;
@@ -40,9 +40,9 @@ isa_ok($foo_stash, 'Package::Stash');
 ok(!defined($Foo::{foo}), '... the %foo slot has not been created yet');
 ok(!$foo_stash->has_package_symbol('%foo'), '... the foo_stash agrees');
 
-ok(!exception {
+is(exception {
     $foo_stash->add_package_symbol('%foo' => { one => 1 });
-}, '... the %foo symbol is created succcessfully');
+}, undef, '... the %foo symbol is created succcessfully');
 
 ok(!defined($Foo::{foo}), '... the %foo slot has not been created in the actual Foo package');
 ok($foo_stash->has_package_symbol('%foo'), '... the foo_stash agrees');
@@ -56,17 +56,17 @@ is($foo, $foo_stash->get_package_symbol('%foo'), '... our %foo is the same as th
 
 ok(!defined($Foo::{bar}), '... the @bar slot has not been created yet');
 
-ok(!exception {
+is(exception {
     $foo_stash->add_package_symbol('@bar' => [ 1, 2, 3 ]);
-}, '... created @Foo::bar successfully');
+}, undef, '... created @Foo::bar successfully');
 
 ok(!defined($Foo::{bar}), '... the @bar slot has still not been created');
 
 ok(!defined($Foo::{baz}), '... the %baz slot has not been created yet');
 
-ok(!exception {
+is(exception {
     $foo_stash->add_package_symbol('%baz');
-}, '... created %Foo::baz successfully');
+}, undef, '... created %Foo::baz successfully');
 
 ok(!defined($Foo::{baz}), '... the %baz slot has still not been created');