Welcome to mirror list, hosted at ThFree Co, Russian Federation.

switch.cs « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 10db17507cebfeed5609eaa5be119d203bbe4342 (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
public class Switch {

	public static int test (int n) {
		switch (n) {
		case 0: return 1;
		case 1: return 0;
		case -1: return 2;
		default:
			return 0xff;
		}
		return 100;
	}
	public static int Main () {
		if (test(0) != 1)
			return 1;
		if (test(1) != 0)
			return 2;
		if (test(-1) != 2)
			return 3;
		if (test(3) != 0xff)
			return 4;
		return 0;
	}
}