2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-linq-12.cs
blobb1afaae6db5e429c9f2e2b4582cdc0817db6c6d1
1 using System;
2 using System.Linq;
4 class NestedQuery
6 public void XX ()
8 var enumerable = new string[] { "aba", "bbb", "bab", "aaa" }.
9 Select((values) => new { values = values, length = values.Length }).
10 Select((ti0) => ti0.values.Select ((type) => new { type = type, x = 9 }).Where((ti1) => (ti0.length == 3)).
11 Select((ti1) => ti1.type));
14 public static int Main ()
16 var e = from values in new [] { "aba", "bbb", "bab", "aaa" }
17 where values.Length > 0
18 select from type in values
19 where type == 'a'
20 select type;
22 int counter = 0;
23 foreach (var v in e)
24 foreach (var vv in v) {
25 ++counter;
26 Console.WriteLine (vv);
30 if (counter != 6)
31 return 1;
33 e = from values in new [] { "aba", "bbb", "bab", "aaa" }
34 let length = values.Length
35 select from type in values
36 let x = 9
37 where length == 3
38 select type;
39 counter = 0;
40 foreach (var v in e)
41 foreach (var vv in v) {
42 ++counter;
43 Console.WriteLine (vv);
46 if (counter != 12)
47 return 2;
49 return 0;