Author: marek
Date: 2007-09-19 10:26:28 -0400 (Wed, 19 Sep 2007)
New Revision: 86013
Added:
trunk/mcs/tests/ltest-01.cs
trunk/mcs/tests/ltest-02.cs
trunk/mcs/tests/ltest-03.cs
trunk/mcs/tests/ltest-04.cs
trunk/mcs/tests/ltest-05.cs
Removed:
trunk/mcs/tests/ltest-1.cs
trunk/mcs/tests/ltest-2.cs
trunk/mcs/tests/ltest-3.cs
trunk/mcs/tests/ltest-4.cs
trunk/mcs/tests/ltest-5.cs
Log:
Use same version schema
Copied: trunk/mcs/tests/ltest-01.cs (from rev 86010, trunk/mcs/tests/ltest-1.cs)
Copied: trunk/mcs/tests/ltest-02.cs (from rev 86010, trunk/mcs/tests/ltest-2.cs)
Copied: trunk/mcs/tests/ltest-03.cs (from rev 86010, trunk/mcs/tests/ltest-3.cs)
Copied: trunk/mcs/tests/ltest-04.cs (from rev 86010, trunk/mcs/tests/ltest-4.cs)
Copied: trunk/mcs/tests/ltest-05.cs (from rev 86010, trunk/mcs/tests/ltest-5.cs)
Deleted: trunk/mcs/tests/ltest-1.cs
===================================================================
--- trunk/mcs/tests/ltest-1.cs 2007-09-19 14:20:21 UTC (rev 86012)
+++ trunk/mcs/tests/ltest-1.cs 2007-09-19 14:26:28 UTC (rev 86013)
@@ -1,62 +0,0 @@
-// Compiler options: -langversion:linq
-//
-// Lambda expression test, basics.
-//
-using System;
-
-delegate int IntFunc (int x);
-delegate void VoidFunc (int x);
-
-class X {
-
- static IntFunc func, increment;
- static VoidFunc nothing;
-
- static int Main ()
- {
- int y = 0;
- int r;
-
- //
- // The following tests body-style lambda
- //
- increment = (int x) => { return x + 1; };
- r = increment (4);
- Console.WriteLine ("Should be 5={0}", r);
- if (r != 5)
- return 1;
-
- //
- // This tests the body of a lambda being an expression
- //
- func = (int x) => x + 1;
- r = func (10);
- Console.WriteLine ("Should be 11={0}", r);
- if (r != 11)
- return 2;
-
- //
- // The following tests that the body is a statement
- //
- nothing = (int x) => { y = x; };
- nothing (10);
- Console.WriteLine ("Should be 10={0}", y);
- if (y != 10)
- return 3;
-
- nothing = (int x) => { new X (x); };
- nothing (314);
- if (instantiated_value != 314)
- return 4;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-
- static int instantiated_value;
-
- X (int v)
- {
- instantiated_value = v;
- }
-}
Deleted: trunk/mcs/tests/ltest-2.cs
===================================================================
--- trunk/mcs/tests/ltest-2.cs 2007-09-19 14:20:21 UTC (rev 86012)
+++ trunk/mcs/tests/ltest-2.cs 2007-09-19 14:26:28 UTC (rev 86013)
@@ -1,27 +0,0 @@
-// Compiler options: -langversion:linq
-//
-// Lambda expression test overload resolution with parameterless arguments
-//
-
-using System;
-delegate string funcs (string s);
-delegate int funci (int i);
-
-class X {
- static void Foo (funci fi)
- {
- int res = fi (10);
- Console.WriteLine (res);
- }
-
- static void Foo (funcs fs)
- {
- string res = fs ("hello");
- Console.WriteLine (res);
- }
-
- static void Main ()
- {
- Foo (x => x + "dingus");
- }
-}
Deleted: trunk/mcs/tests/ltest-3.cs
===================================================================
--- trunk/mcs/tests/ltest-3.cs 2007-09-19 14:20:21 UTC (rev 86012)
+++ trunk/mcs/tests/ltest-3.cs 2007-09-19 14:26:28 UTC (rev 86013)
@@ -1,19 +0,0 @@
-// Compiler options: -langversion:linq
-
-using System;
-
-public delegate TResult Func<TArg0, TResult> (TArg0 arg0);
-
-class Demo
-{
- static Y F<X, Y> (int a, X value, Func<X, Y> f1)
- {
- return f1 (value);
- }
- static int Main ()
- {
- object o = F (1, "1:15:30", s => TimeSpan.Parse (s));
- Console.WriteLine (o);
- return 0;
- }
-}
Deleted: trunk/mcs/tests/ltest-4.cs
===================================================================
--- trunk/mcs/tests/ltest-4.cs 2007-09-19 14:20:21 UTC (rev 86012)
+++ trunk/mcs/tests/ltest-4.cs 2007-09-19 14:26:28 UTC (rev 86013)
@@ -1,30 +0,0 @@
-// Compiler options: -langversion:linq
-//
-// This test is used to test the type information flow between arguments
-// in a generic method invocation, where:
-//
-// 1. We first infer the type of X from the first argument to F
-//
-// 2. We use this information to infer from the type of f1 and Func
-// that X is a TimeSpan.
-//
-// 3. Use the X=String and Y=TimeSpan to infer the value for Z
-// which is double
-//
-
-using System;
-public delegate TResult Func<TArg0, TResult> (TArg0 arg0);
-
-class Demo {
- static Z F<X,Y,Z>(X value, Func<X,Y> f1, Func<Y,Z> f2)
- {
- return f2 (f1(value));
- }
- static int Main ()
- {
- double d = F("1:15:30", s => TimeSpan.Parse(s), t =>
t.TotalSeconds);
- if (d < 4529 || d > 4531)
- return 1;
- return 0;
- }
-}
Deleted: trunk/mcs/tests/ltest-5.cs
===================================================================
--- trunk/mcs/tests/ltest-5.cs 2007-09-19 14:20:21 UTC (rev 86012)
+++ trunk/mcs/tests/ltest-5.cs 2007-09-19 14:26:28 UTC (rev 86013)
@@ -1,32 +0,0 @@
-// Compiler options: -langversion:linq
-
-using System;
-
-public class C
-{
-
- delegate int di (int x);
- delegate string ds (string s);
- delegate bool db (bool x);
-
- static bool M (db d) { return d (false); }
- static string M (ds d) { return "b"; }
- static int M (di d) { return d (0); }
-
- public static int Main ()
- {
- string[] s = new string[] { "1" };
- int[] i = new int[] { 1 };
-
- string s_res = M (x=> M (y=> x.ToLower ()));
- int i_res = M (x=> M (y=> (x * 0) + 5));
-
- if (s_res != "b")
- return 1;
-
- if (i_res != 5)
- return 2;
-
- return 0;
- }
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches