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

test-77.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7da6a379d434d5dea00cece92cc1bd7e8ccf2396 (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
66
67
68
69
70
71
72
73
//
// Tests the various string implicit conversions
//

class XX {

	enum X {
		A = 1
	}
	
	public static int Main ()
	{
		int one = 1;
		int two = 2;
		
		if (("a" + "b") != "ab")
			return 1;

		if (("one" + one) != "one1")
			return 2;

		if ((one + "one") != "1one")
			return 3;

		if ((one + "two" + two) != "1two2")
			return 4;

		if ((X.A + "a") != "Aa")
			return 5;

		if (((int)X.A) + "a" != "1a")
			return 6;
	
		if ((1 + " " + "hello") != "1 hello")
			return 7;
	
		const string s1 = null + (string)null;
		const string s2 = (string)null + null;

		string s;
		s = (string)null + null;
		if (s.Length != 0)
			return 8;

		s = null + (string)null;
		if (s.Length != 0)
			return 9;

		s = (object)null + null;
		if (s.Length != 0)
			return 10;

		s = null + (object)null;
		if (s.Length != 0)
			return 11;

		s = (object)1 + null;
		if (s != "1")
			return 12;

		s = (string)null + (object)null;
		if (s.Length != 0)
			return 13;

		s = (object)null + (string)null;
		if (s.Length != 0)
			return 14;

		System.Console.WriteLine ("test ok");
		return 0;
	}
}