Merge pull request #496 from nicolas-raoul/unit-test-for-issue2907
[mono.git] / mcs / tests / test-77.cs
1 //
2 // Tests the various string implicit conversions
3 //
4
5 class XX {
6
7         enum X {
8                 A = 1
9         }
10         
11         public static int Main ()
12         {
13                 int one = 1;
14                 int two = 2;
15                 
16                 if (("a" + "b") != "ab")
17                         return 1;
18
19                 if (("one" + one) != "one1")
20                         return 2;
21
22                 if ((one + "one") != "1one")
23                         return 3;
24
25                 if ((one + "two" + two) != "1two2")
26                         return 4;
27
28                 if ((X.A + "a") != "Aa")
29                         return 5;
30
31                 if (((int)X.A) + "a" != "1a")
32                         return 6;
33         
34                 if ((1 + " " + "hello") != "1 hello")
35                         return 7;
36         
37                 const string s1 = null + (string)null;
38                 const string s2 = (string)null + null;
39                 
40                 // csc does not compile this one
41                 const string s3 = null + null;  
42         
43                 System.Console.WriteLine ("test ok");
44                 return 0;
45         }
46 }
47