File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Basic "if" tests.
11
11
12
12
# L<S04/Conditional statements>
13
13
14
- plan 25 ;
14
+ plan 29 ;
15
15
16
16
my $ x = ' test' ;
17
17
if ($ x eq $ x ) { pass (' if ($x eq $x) {} works' ); } else { flunk (' if ($x eq $x) {} failed' ); }
@@ -150,6 +150,21 @@ if (Mu) { flunk('if (Mu) {} failed'); } else { pass('if (Mu) {} works'); }
150
150
is $ got , ' ' , ' else -> $c { } binding previous if' ;
151
151
}
152
152
153
+ {
154
+ my $ called = 0 ;
155
+ sub cond ($ when ) {
156
+ is $ called ,$ when ," condition is checked in correct order" ;
157
+ $ called ++ ;
158
+ 0 ;
159
+ }
160
+ if cond(0 ) {
161
+ } elsif cond(1 ) {
162
+ } elsif cond(2 ) {
163
+ }
164
+ is $ called ,3 ," all conditions are checked" ;
165
+ }
166
+
167
+
153
168
# ?niecza skip "eval_unimplemented"
154
169
# L<S04/Statement parsing/keywords require whitespace>
155
170
eval_dies_ok(' if($x > 1) {}' ,' keyword needs at least one whitespace after it' );
You can’t perform that action at this time.
0 commit comments