diff options
author | Miguel de Icaza <miguel@gnome.org> | 2003-03-29 02:21:55 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2003-03-29 02:21:55 +0300 |
commit | 6f02a96296eb28630060610cea737445cd1a3632 (patch) | |
tree | 13973bd943e1c3c5c359b24e64e4ad8cf93d103a /mcs/tests/test-7.cs | |
parent | 03d4e4f037ffe35be1d111eae9fbfddf465b8f9d (diff) |
Update for conditional operator
svn path=/trunk/mcs/; revision=12894
Diffstat (limited to 'mcs/tests/test-7.cs')
-rw-r--r-- | mcs/tests/test-7.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mcs/tests/test-7.cs b/mcs/tests/test-7.cs index d29c20e5b76..8d27a6dec75 100644 --- a/mcs/tests/test-7.cs +++ b/mcs/tests/test-7.cs @@ -8,6 +8,18 @@ namespace Mine { return true; } } + + public class MyTrueFalse { + public static bool operator true (MyTrueFalse i) + { + return true; + } + + public static bool operator false (MyTrueFalse i) + { + return false; + } + } public class Blah { @@ -81,6 +93,13 @@ namespace Mine { if (!myb) return 10; + // + // Tests the conditional operator invoking operator true + MyTrueFalse mf = new MyTrueFalse (); + int x = mf ? 1 : 2; + if (x != 1) + return 11; + Console.WriteLine ("Test passed"); return 0; } |