[svn] r6025: nemerle/trunk/ncc/testsuite/frommcs: gtest-078.n
test-anon-31.n test-iter-11.n
nazgul
svnadmin at nemerle.org
Mon Dec 19 20:29:12 CET 2005
Log:
Add some more tests
Author: nazgul
Date: Mon Dec 19 20:29:06 2005
New Revision: 6025
Added:
nemerle/trunk/ncc/testsuite/frommcs/gtest-078.n (contents, props changed)
nemerle/trunk/ncc/testsuite/frommcs/test-anon-31.n (contents, props changed)
nemerle/trunk/ncc/testsuite/frommcs/test-iter-11.n (contents, props changed)
Added: nemerle/trunk/ncc/testsuite/frommcs/gtest-078.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/frommcs/gtest-078.n Mon Dec 19 20:29:06 2005
@@ -0,0 +1,22 @@
+using System;
+using System.Collections;
+
+public class Test
+{
+ public static Main () : void
+ {
+ foreach ( o :> object in Test ())
+ Console.WriteLine (o);
+ }
+
+ public GetEnumerator () : IEnumerator
+ {
+ foreach ( i :> int in ArrayList ())
+ yield i;
+ }
+}
+
+/*
+BEGIN-OUTPUT
+END-OUTPUT
+*/
Added: nemerle/trunk/ncc/testsuite/frommcs/test-anon-31.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/frommcs/test-anon-31.n Mon Dec 19 20:29:06 2005
@@ -0,0 +1,40 @@
+// Test case for Bug #75934
+// Checks for duplicate field names
+
+using System;
+using System.Collections;
+using System.Reflection;
+
+class test
+{
+ public testen (mutable x : int) : IEnumerable
+ {
+ for (mutable i = 0;i < x; i++)
+ if (i % 2 == 0) {
+ mutable o = i;
+ yield o;
+ } else {
+ mutable o = i*2;
+ yield o;
+ }
+ }
+}
+
+class reflect
+{
+ public static Main (_ : array [string]) : void
+ {
+ mutable ht = Hashtable ();
+ mutable asm = Assembly.GetAssembly (typeof (test));
+ foreach ( t :> Type in asm.GetTypes ()) {
+ ht.Clear ();
+ foreach ( fi :> FieldInfo in t.GetFields (BindingFlags.Public %| BindingFlags.NonPublic %| BindingFlags.Instance))
+ ht.Add (fi.Name, fi);
+ }
+ }
+}
+
+/*
+BEGIN-OUTPUT
+END-OUTPUT
+*/
Added: nemerle/trunk/ncc/testsuite/frommcs/test-iter-11.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/frommcs/test-iter-11.n Mon Dec 19 20:29:06 2005
@@ -0,0 +1,36 @@
+using System;
+using System.Collections;
+
+class X {
+ public event Hook : EventHandler;
+
+ public Pipeline () : IEnumerator
+ {
+ when (Hook == null)
+ throw Exception ("error");
+
+ Hook (this, EventArgs.Empty);
+
+ yield 0;
+ }
+
+ static M (_ : object, _ : EventArgs) : void
+ {
+ Console.WriteLine ("Hook invoked");
+ }
+
+ static Main () : void
+ {
+ mutable x = X ();
+ x.Hook += M;
+ mutable y = x.Pipeline ();
+ _ = y.MoveNext ();
+ }
+}
+
+
+/*
+BEGIN-OUTPUT
+Hook invoked
+END-OUTPUT
+*/
More information about the svn
mailing list