New test.
authorMarek Safar <marek.safar@gmail.com>
Wed, 19 Mar 2008 14:52:17 +0000 (14:52 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 19 Mar 2008 14:52:17 +0000 (14:52 -0000)
svn path=/trunk/mcs/; revision=98597

mcs/tests/gtest-exmethod-19.cs [new file with mode: 0644]

diff --git a/mcs/tests/gtest-exmethod-19.cs b/mcs/tests/gtest-exmethod-19.cs
new file mode 100644 (file)
index 0000000..0a0a180
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+
+public static class Rocks
+{
+       public static string Test_1 (this string t)
+       {
+               return t + ":";
+       }
+       
+       public static int Test_2<T> (this IEnumerable<T> e)
+       {
+               return 33;
+       }
+}
+
+public class Test
+{
+       delegate string D ();
+
+       static int Main ()
+       {
+               string s = "jaj";
+
+               D d = s.Test_1;
+               Func<int> d2 = "33".Test_2;
+               
+               if ((string)d.Target != "jaj")
+                       return 10;
+               
+               if ((string)d2.Target != "33")
+                       return 11;
+
+               string res = d ();
+               Console.WriteLine (res);
+               if (res != "jaj:")
+                       return 1;
+                       
+               if (d2 () != 33)
+                       return 2;
+                       
+               return 0;
+       }
+}