2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-165.cs
blob6ed567b228835f4e4e418c5ecd21d01dea8ad0b4
1 using System;
2 using System.Collections;
4 class X {
5 delegate void A ();
7 static IEnumerable GetIt (int [] args)
9 foreach (int arg in args) {
10 Console.WriteLine ("OUT: {0}", arg);
11 A a = delegate {
12 Console.WriteLine ("arg: {0}", arg);
13 return;
15 a ();
16 yield return arg;
20 static int Main ()
22 int total = 0;
23 foreach (int i in GetIt (new int [] { 1, 2, 3})){
24 Console.WriteLine ("Got: " + i);
25 total += i;
28 if (total != 6)
29 return 1;
31 return 0;