Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2008-10-03 21:27:36 +0400
committerMarek Safar <marek.safar@gmail.com>2008-10-03 21:27:36 +0400
commit5936fd231f78a10cf48bad8fb339b2ebfe65a991 (patch)
tree03c0f27757de5d2a17ba777cab9a27558de7bc62 /mcs/tests/gtest-iter-10.cs
parent486182fd3ee60988ffc72bb24cca02af7bc71e8b (diff)
New test.
svn path=/trunk/mcs/; revision=114765
Diffstat (limited to 'mcs/tests/gtest-iter-10.cs')
-rwxr-xr-xmcs/tests/gtest-iter-10.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/mcs/tests/gtest-iter-10.cs b/mcs/tests/gtest-iter-10.cs
new file mode 100755
index 00000000000..68c4f7dcdd7
--- /dev/null
+++ b/mcs/tests/gtest-iter-10.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+
+class Test
+{
+ static IEnumerable<int> FromTo (int from, int to)
+ {
+ while (from <= to) yield return from++;
+ }
+
+ static int Main ()
+ {
+ IEnumerable<int> e = FromTo (1, 10);
+
+ int i = 0;
+ foreach (int x in e) {
+ foreach (int y in e) {
+ i += y;
+ Console.Write ("{0,3} ", x * y);
+ }
+ Console.WriteLine ();
+ }
+
+ Console.WriteLine (i);
+ if (i != 550)
+ return i;
+
+ return 0;
+ }
+}