Align libgc vcxproj with makefile.
[mono.git] / mono / tests / string-compare.cs
1 using System;
2
3 namespace T {
4         struct datum {
5                 public string a;
6                 public string b;
7                 public int result;
8
9                 public datum (string A, string B, int r) {
10                         a = A;
11                         b = B;
12                         result =r;
13                 }
14
15                 public bool match () {
16                         int r = String.Compare (a, b);
17                         switch (result) {
18                         case -1:
19                                 if (r < 0) return true;
20                                 break;
21                         case 0:
22                                 if (r == 0) return true;
23                                 break;
24                         case 1:
25                                 if (r > 0) return true;
26                                 break;
27                         default:
28                                 return false;
29                         }
30                         return false;
31                 }
32         }
33         public class test {
34                 public static int Main() {
35                         datum[] data = {
36                                 new datum ("a", "b", -1),
37                                 new datum ("a", "a", 0),
38                                 new datum ("b", "a", 1),
39                                 new datum ("ba", "b", 1),
40                                 new datum ("b", "ba", -1),
41                         };
42                         int i;
43                         for (i = 0; i < data.Length; ++i) {
44                                 if (!data[i].match())
45                                         return i+1;
46                         }
47                         return 0;
48                 }
49         }
50 }