our @yay;
is_deeply(\@yay, [ 11, 13 ], 'yay really was executed');
-eval "flip"; # Not called in sub::auto zone, not declared, not defined
+eval "flip"; # Not called in subs::auto zone, not declared, not defined
_got_bareword('flip', 1, eval => 1);
-eval "flop"; # Not called in sub::auto zone, declared outside, not defined
+eval "flop"; # Not called in subs::auto zone, declared outside, not defined
_got_undefined('flop', 1, eval => 1);
my $qux;
-eval "qux"; # Called in sub::auto zone, not declared, not defined
+eval "qux"; # Called in subs::auto zone, not declared, not defined
_got_bareword('qux', 1, eval => 1);
my $blech;
-eval "blech"; # Called in sub::auto zone, declared outside, not defined
+eval "blech"; # Called in subs::auto zone, declared outside, not defined
_got_undefined('blech', 1, eval => 1);
my $wut;
-eval "wut"; # Called in sub::auto zone, declared and defined outside
+eval "wut"; # Called in subs::auto zone, declared and defined outside
_got_ok('compiling to wut()');
# === Starting from here ======================================================
use subs::auto;
-# ... Called in sub::auto zone only, not declared, not defined ................
+# ... Called in subs::auto zone only, not declared, not defined ...............
eval { onlycalledonce 1, 2 };
_got_undefined('onlycalledonce', __LINE__-1);
my $foo;
our @foo;
-# ... Called in sub::auto zone, declared and defined inside ...................
+# ... Called in subs::auto zone, declared and defined inside ..................
eval { foo 1, 2, \%h };
_got_ok('compiling to foo(1,2,\\\%h)');
_got_ok('compiling to foo(7,8,\\\%h)');
is($foo, 27, '&foo() really was executed');
-# ... Called in sub::auto zone, declared and defined outside ..................
+# ... Called in subs::auto zone, declared and defined outside .................
eval { wut 13, "what" };
_got_ok('compiling to wut(13,"what")');
_got_ok('compiling to wut(25,"what")');
is($wut, 29, '&wut() really was executed');
-# ... Called in sub::auto zone, not declared, not defined .....................
+# ... Called in subs::auto zone, not declared, not defined ....................
eval { qux };
_got_undefined('qux', __LINE__-1);
$warn = undef;
eval {
- local $SIG{__WARN__} = sub { $warn = $_[0] =~ /Subroutine\s+\S+redefined/ };
+ local $SIG{__WARN__} = sub { $warn = $_[0] =~ /Subroutine\s+\S+redefined/ };
local *qux = sub { $qux = $_[0] };
qux 5;
};
no strict;
no warnings 'reserved';
blech;
- }
+ }
}
};
_got_ok('compiling to bareword');