2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git] / tests / gtest-linq-02.cs
blob4bf222a188a60df884b1ca115b2286b78687dc52
1 // Compiler options: -langversion:linq
3 using System;
4 using System.Collections.Generic;
5 using System.Linq;
7 class Test
9 public static int Main ()
11 int[] int_array = new int [] { 0, 1 };
13 IEnumerable<int> e;
14 int pos;
16 e = from int i in int_array select i;
17 pos = 0;
18 foreach (int actual in e) {
19 Console.WriteLine (actual);
20 if (int_array [pos++] != actual)
21 return pos;
24 e = from int i in int_array select 19;
25 pos = 0;
26 foreach (int actual in e) {
27 Console.WriteLine (actual);
28 if (actual != 19)
29 return actual;
32 Console.WriteLine ("OK");
33 return 0;