summaryrefslogtreecommitdiffstats
path: root/t/04-get.t
diff options
context:
space:
mode:
Diffstat (limited to 't/04-get.t')
-rw-r--r--t/04-get.t52
1 files changed, 26 insertions, 26 deletions
diff --git a/t/04-get.t b/t/04-get.t
index 64847da..7205457 100644
--- a/t/04-get.t
+++ b/t/04-get.t
@@ -9,7 +9,7 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Hash');
- my $val = $stash->get_package_symbol('%foo');
+ my $val = $stash->get_symbol('%foo');
is($val, undef, "got nothing yet");
}
{
@@ -18,10 +18,10 @@ use Scalar::Util;
}
BEGIN {
my $stash = Package::Stash->new('Hash');
- my $val = $stash->get_package_symbol('%foo');
+ my $val = $stash->get_symbol('%foo');
is(ref($val), 'HASH', "got something");
$val->{bar} = 1;
- is_deeply($stash->get_package_symbol('%foo'), {bar => 1},
+ is_deeply($stash->get_symbol('%foo'), {bar => 1},
"got the right variable");
is_deeply(\%Hash::foo, {bar => 1},
"stash has the right variable");
@@ -31,7 +31,7 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Array');
- my $val = $stash->get_package_symbol('@foo');
+ my $val = $stash->get_symbol('@foo');
is($val, undef, "got nothing yet");
}
{
@@ -40,10 +40,10 @@ use Scalar::Util;
}
BEGIN {
my $stash = Package::Stash->new('Array');
- my $val = $stash->get_package_symbol('@foo');
+ my $val = $stash->get_symbol('@foo');
is(ref($val), 'ARRAY', "got something");
push @$val, 1;
- is_deeply($stash->get_package_symbol('@foo'), [1],
+ is_deeply($stash->get_symbol('@foo'), [1],
"got the right variable");
is_deeply(\@Array::foo, [1],
"stash has the right variable");
@@ -53,7 +53,7 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Scalar');
- my $val = $stash->get_package_symbol('$foo');
+ my $val = $stash->get_symbol('$foo');
is($val, undef, "got nothing yet");
}
{
@@ -62,10 +62,10 @@ use Scalar::Util;
}
BEGIN {
my $stash = Package::Stash->new('Scalar');
- my $val = $stash->get_package_symbol('$foo');
+ my $val = $stash->get_symbol('$foo');
is(ref($val), 'SCALAR', "got something");
$$val = 1;
- is_deeply($stash->get_package_symbol('$foo'), \1,
+ is_deeply($stash->get_symbol('$foo'), \1,
"got the right variable");
is($Scalar::foo, 1,
"stash has the right variable");
@@ -75,7 +75,7 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Code');
- my $val = $stash->get_package_symbol('&foo');
+ my $val = $stash->get_symbol('&foo');
is($val, undef, "got nothing yet");
}
{
@@ -84,13 +84,13 @@ use Scalar::Util;
}
BEGIN {
my $stash = Package::Stash->new('Code');
- my $val = $stash->get_package_symbol('&foo');
+ my $val = $stash->get_symbol('&foo');
is(ref($val), 'CODE', "got something");
is(prototype($val), undef, "got the right variable");
&Scalar::Util::set_prototype($val, '&');
- is($stash->get_package_symbol('&foo'), $val,
+ is($stash->get_symbol('&foo'), $val,
"got the right variable");
- is(prototype($stash->get_package_symbol('&foo')), '&',
+ is(prototype($stash->get_symbol('&foo')), '&',
"got the right variable");
is(prototype(\&Code::foo), '&',
"stash has the right variable");
@@ -100,7 +100,7 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Io');
- my $val = $stash->get_package_symbol('FOO');
+ my $val = $stash->get_symbol('FOO');
is($val, undef, "got nothing yet");
}
{
@@ -110,13 +110,13 @@ use Scalar::Util;
}
BEGIN {
my $stash = Package::Stash->new('Io');
- my $val = $stash->get_package_symbol('FOO');
+ my $val = $stash->get_symbol('FOO');
isa_ok($val, 'IO');
my $str = "foo";
open $val, '<', \$str;
- is(readline($stash->get_package_symbol('FOO')), "foo",
+ is(readline($stash->get_symbol('FOO')), "foo",
"got the right variable");
- seek($stash->get_package_symbol('FOO'), 0, 0);
+ seek($stash->get_symbol('FOO'), 0, 0);
{
package Io;
::isa_ok(*FOO{IO}, 'IO');
@@ -128,10 +128,10 @@ use Scalar::Util;
{
my $stash = Package::Stash->new('Hash::Vivify');
- my $val = $stash->get_or_add_package_symbol('%foo');
+ my $val = $stash->get_or_add_symbol('%foo');
is(ref($val), 'HASH', "got something");
$val->{bar} = 1;
- is_deeply($stash->get_or_add_package_symbol('%foo'), {bar => 1},
+ is_deeply($stash->get_or_add_symbol('%foo'), {bar => 1},
"got the right variable");
no warnings 'once';
is_deeply(\%Hash::Vivify::foo, {bar => 1},
@@ -140,10 +140,10 @@ use Scalar::Util;
{
my $stash = Package::Stash->new('Array::Vivify');
- my $val = $stash->get_or_add_package_symbol('@foo');
+ my $val = $stash->get_or_add_symbol('@foo');
is(ref($val), 'ARRAY', "got something");
push @$val, 1;
- is_deeply($stash->get_or_add_package_symbol('@foo'), [1],
+ is_deeply($stash->get_or_add_symbol('@foo'), [1],
"got the right variable");
no warnings 'once';
is_deeply(\@Array::Vivify::foo, [1],
@@ -152,10 +152,10 @@ use Scalar::Util;
{
my $stash = Package::Stash->new('Scalar::Vivify');
- my $val = $stash->get_or_add_package_symbol('$foo');
+ my $val = $stash->get_or_add_symbol('$foo');
is(ref($val), 'SCALAR', "got something");
$$val = 1;
- is_deeply($stash->get_or_add_package_symbol('$foo'), \1,
+ is_deeply($stash->get_or_add_symbol('$foo'), \1,
"got the right variable");
no warnings 'once';
is($Scalar::Vivify::foo, 1,
@@ -165,13 +165,13 @@ use Scalar::Util;
{
BEGIN {
my $stash = Package::Stash->new('Io::Vivify');
- my $val = $stash->get_or_add_package_symbol('FOO');
+ my $val = $stash->get_or_add_symbol('FOO');
isa_ok($val, 'IO');
my $str = "foo";
open $val, '<', \$str;
- is(readline($stash->get_package_symbol('FOO')), "foo",
+ is(readline($stash->get_symbol('FOO')), "foo",
"got the right variable");
- seek($stash->get_package_symbol('FOO'), 0, 0);
+ seek($stash->get_symbol('FOO'), 0, 0);
}
{
package Io::Vivify;