aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/v/gen/native/tests/ifs.vv
blob: 674d4aa905d4b75dd30dee06e427fb0c7a00efb3 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
fn print_number(n int) {
	if n == 0 {
		println('print_number')
	}
}

fn test_add() {
	n := 3
	print_number(0)
	print_number(1)
	if n > 1 {
		println('var(3) > 1')
	}
	/*
	if 1 < n {
		println('1 < var(3)')
	}
	if 1 > n {
		println('1 > 3 ERROR')
	}
	*/
	if 1 < 3 {
		println('1 < 3')
	}
	if 1 == 1 {
		println('1 == 1')
		// TODO assert here
	}
	if 1 != 3 {
		println('1 != 3')
		// TODO assert here
	}
	if 3 != 3 {
		println('3 != 3 ERROR')
		// TODO assert here
	}
	if 1 > 3 {
		println('1 > 3 ERROR')
		// TODO assert here
	}
}

/*
fn test_elses() {
	println('start else')
	if 1 < 2 {
		println('ok')
	} else {
		println('1<2else ERROR')
	}
	if 1 > 2 {
		println('1<2else ERROR')
	} else {
		println('ok')
	}
	println('end else')
}
*/

fn main() {
	println('start')
	test_add()
	// test_elses()
	println('end')
}