aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/v/fmt/tests/labelled_break_continue_keep.vv
blob: 89fb1d2914a86dab518f67d1bbf0c2fcb200fd9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
fn test_labelled_for() {
	mut i := 4
	goto L1
	L1: for {
		i++
		for {
			if i < 7 {
				continue L1
			} else {
				break L1
			}
		}
	}
	assert i == 7
	goto L2
	L2: for ; true; i++ {
		for {
			if i < 17 {
				continue L2
			} else {
				break L2
			}
		}
	}
	assert i == 17
	goto L3
	L3: for e in [1, 2, 3, 4] {
		i = e
		for {
			if i < 3 {
				continue L3
			} else {
				break L3
			}
		}
	}
	assert i == 3
}