New test
authorMarek Safar <marek.safar@gmail.com>
Mon, 14 Feb 2011 13:15:59 +0000 (13:15 +0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 14 Feb 2011 13:20:50 +0000 (13:20 +0000)
mcs/tests/gtest-iter-19.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_0.xml

diff --git a/mcs/tests/gtest-iter-19.cs b/mcs/tests/gtest-iter-19.cs
new file mode 100644 (file)
index 0000000..3b4dc80
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+using System.Linq;
+using System.Collections;
+using System.Collections.Generic;
+
+public static class IEnumerableTransform
+{
+
+       public static IEnumerable<TOut> Transform<TOut> (this IEnumerable<int> input, EmitterFunc<TOut> rule)
+       {
+               foreach (var v in input) {
+                       TOut output;
+                       rule (out output);
+                       yield return output;
+               }
+       }
+
+       public static EmitterFunc<TOut> Emit<TOut> (TOut result)
+       {
+               return delegate (out TOut output) {
+                       output = result;
+               };
+       }
+
+       public delegate void EmitterFunc<TOut> (out TOut output);
+
+       public static int Main ()
+       {
+               IEnumerable<int> arr = new int[3];
+               if (!arr.Transform<char> (IEnumerableTransform.Emit<char> ('t')).SequenceEqual(new char[] { 't', 't', 't'}))
+                       return 1;
+
+               return 0;
+       }
+}
index 46bcd7b6f84dceefd1a2206bfdb070a7ecba8871..e46f595120661187a49b4c3d98c7e47f22c50546 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-iter-19.cs">
+    <type name="IEnumerableTransform">
+      <method name="IEnumerable`1 Transform[TOut](IEnumerable`1, IEnumerableTransform+EmitterFunc`1[TOut])">
+        <size>44</size>
+      </method>
+      <method name="IEnumerableTransform+EmitterFunc`1[TOut] Emit[TOut](TOut)">
+        <size>26</size>
+      </method>
+      <method name="Int32 Main()">
+        <size>51</size>
+      </method>
+    </type>
+    <type name="IEnumerableTransform+EmitterFunc`1[TOut]">
+      <method name="Void Invoke(TOut ByRef)">
+        <size>0</size>
+      </method>
+      <method name="IAsyncResult BeginInvoke(TOut ByRef, System.AsyncCallback, System.Object)">
+        <size>0</size>
+      </method>
+      <method name="Void EndInvoke(TOut ByRef, IAsyncResult)">
+        <size>0</size>
+      </method>
+      <method name="Void .ctor(Object, IntPtr)">
+        <size>0</size>
+      </method>
+    </type>
+    <type name="IEnumerableTransform+&lt;Transform&gt;c__Iterator0`1[TOut]">
+      <method name="TOut System.Collections.Generic.IEnumerator&lt;TOut&gt;.get_Current()">
+        <size>7</size>
+      </method>
+      <method name="System.Object System.Collections.IEnumerator.get_Current()">
+        <size>12</size>
+      </method>
+      <method name="IEnumerator System.Collections.IEnumerable.GetEnumerator()">
+        <size>7</size>
+      </method>
+      <method name="IEnumerator`1 System.Collections.Generic.IEnumerable&lt;TOut&gt;.GetEnumerator()">
+        <size>52</size>
+      </method>
+      <method name="Boolean MoveNext()">
+        <size>191</size>
+      </method>
+      <method name="Void Dispose()">
+        <size>62</size>
+      </method>
+      <method name="Void Reset()">
+        <size>6</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="IEnumerableTransform+&lt;Emit&gt;c__AnonStorey1`1[TOut]">
+      <method name="Void &lt;&gt;m__0(TOut ByRef)">
+        <size>13</size>
+      </method>
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-lambda-01.cs">
     <type name="X">
       <method name="Int32 Main()">
       </method>
     </type>
   </test>
-  <test name="gtest-repl-01.cs">
-    <type name="MyTest">
-      <method name="Void Run(System.String, System.String)">
-        <size>23</size>
-      </method>
-      <method name="Void Evaluate(System.String, System.String, System.Object)">
-        <size>75</size>
-      </method>
-      <method name="Void Main()">
-        <size>561</size>
-      </method>
-      <method name="Void .ctor()">
-        <size>7</size>
-      </method>
-    </type>
-  </test>
   <test name="gtest-var-04.cs">
     <type name="Test">
       <method name="Void .ctor()">