New test.
authorMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:45:35 +0000 (20:45 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:45:35 +0000 (20:45 -0000)
svn path=/trunk/mcs/; revision=66251

1  2 
mcs/tests/test-anon-50.cs

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..72c046e357418910bba54b31e1ac505f84490a0e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,51 @@@
++// Compiler options: -langversion:default
++
++using System;
++using System.Collections;
++
++public class Test
++{
++      public IEnumerable Foo (int a)
++      {
++              yield return a;
++              yield return a * a;
++              yield break;
++      }
++}
++
++class X
++{
++      static int Main ()
++      {
++              Test test = new Test ();
++
++              IEnumerable a = test.Foo (5);
++
++              IEnumerator c = a.GetEnumerator ();
++              if (!c.MoveNext ())
++                      return 5;
++              if ((int) c.Current != 5)
++                      return 6;
++              if (!c.MoveNext ())
++                      return 7;
++              if ((int) c.Current != 25)
++                      return 8;
++
++              IEnumerator d = a.GetEnumerator ();
++
++              if ((int) c.Current != 25)
++                      return 9;
++              if (!d.MoveNext ())
++                      return 10;
++              if ((int) c.Current != 25)
++                      return 11;
++              if ((int) d.Current != 5)
++                      return 12;
++
++              if (c.MoveNext ())
++                      return 13;
++
++              ((IDisposable) a).Dispose ();
++              return 0;
++      }
++}