aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/v/fmt/tests/match_expected.vv
blob: 556768f95cc3bf91c21820887a3da0a611a1c0c0 (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 match_expr_assignment() {
	a := 20
	_ := match a {
		10 { 10 }
		5 { 5 }
		else { 2 }
	}
}

fn match_branch_comment() {
	a := 1
	match a {
		1 {
			println('1')
		}
		2 {
			println('2')
		}
		else {
			// do nothing
		}
	}
}

fn really_long_branch_exprs() {
	match x {
		NodeError, ArrayDecompose, ArrayInit, AsCast, Assoc, AtExpr, BoolLiteral, CallExpr,
		MapInit, MatchExpr, None, OffsetOf, OrExpr, ParExpr, PostfixExpr, PrefixExpr, RangeExpr,
		SelectExpr, SelectorExpr, SizeOf, SqlExpr, StringInterLiteral, StringLiteral, StructInit {
			return expr.pos
		}
		InfixExpr {
			Foo{
				x: 3
			}
		}
	}
}