Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 388b017bdc
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.634 kb
use v6;
use Test;
plan 7;
sub callerunderscore ($foo = $CALLER::_) {
return "-" ~ $foo ~ "-"
}
is(callerunderscore("foo"), "-foo-", 'CALLER:: string arg');
is(callerunderscore(1), "-1-", 'CALLER:: number arg');
$_ = "foo";
is(callerunderscore(), "-foo-", 'CALLER:: $_ set once');
$_ = "bar";
is(callerunderscore(), "-bar-", 'CALLER:: $_ set twice');
for ("quux") {
#?pugs todo
is(callerunderscore(), '-quux-', 'CALLER:: $_ set by for');
}
given 'hirgel' {
#?pugs todo
is callerunderscore, '-hirgel-', '$CALLER::_ set by given';
}
is(callerunderscore(), '-bar-', 'CALLER:: $_ reset after for');
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.