2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-lambda-08.cs
blob80b27c3a728023d5392132606b0041f41169ac4b
3 using System;
4 using System.Linq;
5 using System.Collections.Generic;
7 public class C
9 static void Test<T, R> (Func<T, R> d)
13 public static int Main ()
15 Test ((int x) => { return x + 1; });
17 int[] source = new int[] { 2, 1, 0 };
18 IEnumerable<int> e = source.Where((i) => i == 0).Select((i) => i + 1);
20 if (e.ToList ()[0] != 1)
21 return 1;
23 e = source.Where((int i) => i == 0).Select((int i) => i + 1);
25 if (e.ToList ()[0] != 1)
26 return 2;
28 e = source.Where(delegate (int i) { return i == 0; }).Select(delegate (int i) { return i + 1; });
30 if (e.ToList ()[0] != 1)
31 return 3;
33 return 0;