2010-05-13 Rodrigo Kumpera <rkumpera@novell.com>
[mono-project.git] / mcs / tests / test-12.cs
blobd820033b966dbb715f0f91a6b98e68893a12d09e
1 /*
2 * Tests the ?: operator and the string concatenation
3 */
5 using System;
6 class X {
7 static int Main (string [] args)
9 string a = "hello";
10 string b = "1";
11 string c = a + b;
12 string d = a + 1;
13 string y;
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;
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;
31 string [] blah = { "A"+'B'+"C" };
32 if (blah [0] != "ABC")
33 return 7;
35 Console.WriteLine (c);
36 return 0;
39 static string s (string a, int o)
41 return a + o;
43 static string x (string s, object o)
45 return s + o;