[mcs] Add codegen for null operator on result of awaited instance expression of prope...
[mono.git] / mcs / tests / test-12.cs
1 /*
2  * Tests the ?: operator and the string concatenation
3  */
4
5 using System;
6 class X {
7         public static int Main (string [] args)
8         {
9                 string a = "hello";
10                 string b = "1";
11                 string c = a + b;
12                 string d = a + 1;
13                 string y;
14                 
15                 if (c != d)
16                         return 1;
17                 if (d != (a + b))
18                         return 2;
19                 if (d != x (a, b))
20                         return 3;
21                 if (d != x (a, 1))
22                         return 4;
23
24                 y = c == d ? "equal" : "not-equal";
25                 if (y != "equal")
26                         return 5;
27                 y = b == a ? "oops" : "nice";
28                 if (y != "nice")
29                         return 6;
30                 
31                 string [] blah = { "A"+'B'+"C" };
32                 if (blah [0] != "ABC")
33                         return 7;
34                 
35                 Console.WriteLine (c);
36                 return 0;
37         }
38
39         static string s (string a, int o)
40         {
41                 return a + o;
42         }
43         static string x (string s, object o)
44         {
45                 return s + o;
46         }
47
48 }