sync impl-selection tests
[gitmo/Package-Stash.git] / t / impl-selection / basic-xs.t
index 0fe2aa3..8a1b40b 100644 (file)
@@ -257,6 +257,8 @@ 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'),
+       "add_symbol with single argument doesn't vivify scalar slot");
 
     my $syms = $foo_stash->get_all_symbols('HASH');
 
@@ -422,4 +424,24 @@ like(exception {
     );
 }
 
+for my $package ('Foo:Bar', 'Foo/Bar', 'Foo Bar', 'Foo:::Bar', '') {
+    like(
+        exception { Package::Stash->new($package) },
+        qr/^$package is not a module name/,
+        "$package is not a module name"
+    );
+}
+
+like(
+    exception { Package::Stash->new([]) },
+    qr/^Package::Stash->new must be passed the name of the package to access/,
+    "module name must be a string"
+);
+
+like(
+    exception { Package::Stash->new(undef) },
+    qr/^Package::Stash->new must be passed the name of the package to access/,
+    "module name must be a string"
+);
+
 done_testing;