Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (15 sloc) 313 Bytes
#! nqp
# implicit and explicit returns from subs
plan(3);
sub foo() { 1; }
sub bar() {
return 2;
0;
}
sub baz() {
if (1) { return 3; }
0;
}
ok( foo() == 1 , 'last value in block' );
ok( bar() == 2 , 'explicit return value in block');
ok( baz() == 3 , 'explicit return from nested block');
Jump to Line
Something went wrong with that request. Please try again.