Add indexer test, does not work yet
authorMiguel de Icaza <miguel@gnome.org>
Sun, 21 Oct 2001 17:00:24 +0000 (17:00 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 21 Oct 2001 17:00:24 +0000 (17:00 -0000)
svn path=/trunk/mcs/; revision=1190

mcs/tests/test-28.cs [new file with mode: 0644]

diff --git a/mcs/tests/test-28.cs b/mcs/tests/test-28.cs
new file mode 100644 (file)
index 0000000..be95c09
--- /dev/null
@@ -0,0 +1,34 @@
+class X {
+       int v1, v2;
+       
+       int this [int a] {
+               get {
+                       if (a == 0)
+                               return v1;
+                       else
+                               return v2;
+               }
+
+               set {
+                       if (a == 0)
+                               v1 = value;
+                       else
+                               v2 = value;
+               }
+       }
+
+       static int Main ()
+       {
+               X x = new X ();
+
+               x [0] = 1;
+               if (x.v1 != 1)
+                       return 1;
+
+               if (x [0] != 1)
+                       return 2;
+
+               return 0;
+               
+       }
+}