Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 24 lines (15 sloc) 0.313 kB
e8e8388 @pmichaud [nqp]: Add return statement.
pmichaud authored
1 #! nqp
2
3 # implicit and explicit returns from subs
4
5 plan(3);
6
7 sub foo() { 1; }
8
9
10 sub bar() {
11 return 2;
12 0;
13 }
14
15 sub baz() {
16 if (1) { return 3; }
17 0;
18 }
19
20 ok( foo() == 1 , 'last value in block' );
21 ok( bar() == 2 , 'explicit return value in block');
22 ok( baz() == 3 , 'explicit return from nested block');
23
Something went wrong with that request. Please try again.