Support default
case in the non-last position
This commit is contained in:
18
unittests/switch_default_2.chai
Normal file
18
unittests/switch_default_2.chai
Normal file
@@ -0,0 +1,18 @@
|
||||
var total = 0;
|
||||
|
||||
switch(2) {
|
||||
case (1) {
|
||||
total += 1;
|
||||
}
|
||||
default {
|
||||
total += 16;
|
||||
}
|
||||
case (3) {
|
||||
total += 4;
|
||||
}
|
||||
case (4) {
|
||||
total += 8;
|
||||
}
|
||||
}
|
||||
|
||||
assert_equal(total, 28)
|
Reference in New Issue
Block a user