Merge pull request #4431 from vkargov/vk-leaking-points
[mono.git] / mcs / tests / gtest-linq-12.cs
1 using System;
2 using System.Linq;
3
4 class NestedQuery
5 {
6         public void XX ()
7         {
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));
12         }
13         
14         public static int Main ()
15         {
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;
21                 
22                 int counter = 0;
23                 foreach (var v in e)
24                         foreach (var vv in v) {
25                                 ++counter;
26                                 Console.WriteLine (vv);
27                         }
28                         
29                 
30                 if (counter != 6)
31                         return 1;
32                         
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);
44                         }
45                         
46                 if (counter != 12)
47                         return 2;
48                         
49                 return 0;
50         }
51 }