diff options
author | Miguel de Icaza <miguel@gnome.org> | 2001-11-08 03:17:45 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2001-11-08 03:17:45 +0300 |
commit | 52bbd6cf4057f1691d23a5cff241a49fed9f6d4d (patch) | |
tree | 0bd284d7e7eb99d572de2ca24fa51d050c9cfb10 /mcs/tests/test-38.cs | |
parent | 3c3ef2ba0fecc567b667eb5ffa0f55a003d9977c (diff) |
Add more tests
svn path=/trunk/mcs/; revision=1285
Diffstat (limited to 'mcs/tests/test-38.cs')
-rwxr-xr-x | mcs/tests/test-38.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mcs/tests/test-38.cs b/mcs/tests/test-38.cs new file mode 100755 index 00000000000..69dbbc3f936 --- /dev/null +++ b/mcs/tests/test-38.cs @@ -0,0 +1,36 @@ +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 (); + int b; + + x [0] = x [1] = 1; + x [0] = 1; + if (x.v1 != 1) + return 1; + + if (x [0] != 1) + return 2; + + return 0; + + } +} |