diff options
Diffstat (limited to 'spec/inputs/test/break_multiple_values_spec.yue')
| -rw-r--r-- | spec/inputs/test/break_multiple_values_spec.yue | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/inputs/test/break_multiple_values_spec.yue b/spec/inputs/test/break_multiple_values_spec.yue index 846be00..053008d 100644 --- a/spec/inputs/test/break_multiple_values_spec.yue +++ b/spec/inputs/test/break_multiple_values_spec.yue | |||
| @@ -838,3 +838,22 @@ describe "break with multiple values", -> | |||
| 838 | break | 838 | break |
| 839 | assert.same x, 5 | 839 | assert.same x, 5 |
| 840 | assert.same y, 15 | 840 | assert.same y, 15 |
| 841 | |||
| 842 | it "should allow nesting do and for", -> | ||
| 843 | x, y = do | ||
| 844 | min, max = 1, 10 | ||
| 845 | if max > min | ||
| 846 | break for j = min, max | ||
| 847 | break j, j * 10 if j > 5 | ||
| 848 | break 0, 0 | ||
| 849 | assert.same x, 6 | ||
| 850 | assert.same y, 60 | ||
| 851 | |||
| 852 | it "should allow nesting do and with", -> | ||
| 853 | x = with a: 123, b: true | ||
| 854 | do | ||
| 855 | if .b | ||
| 856 | break with a: .a, b: .b, c: "ok" | ||
| 857 | if .b and .c == "ok" | ||
| 858 | break .a | ||
| 859 | assert.same x, 123 | ||
