Add test for #636939
authorJb Evain <jbevain@gmail.com>
Fri, 10 Sep 2010 14:18:35 +0000 (16:18 +0200)
committerJb Evain <jbevain@gmail.com>
Fri, 10 Sep 2010 14:18:47 +0000 (16:18 +0200)
mcs/class/corlib/Test/System.Reflection/BinderTests.cs

index a602169aee39cc912fea5591118d9a5ea1fff71b..c84d0d6eb17fb246399c90864998d0481a8db42b 100644 (file)
@@ -1332,5 +1332,26 @@ namespace MonoTests.System.Reflection
        
                        AssertingBinder.Instance.SelectMethod (flags, new MethodBase [] {m0, m1}, new Type[] { typeof (int) }, null);
                }
+
+               public static string Bug636939 (IFormatProvider provider, string pattern, params object [] args)
+               {
+                       return string.Format (pattern, args);
+               }
+
+               [Test] // bug #636939
+               public void SelectMethodWithParamArrayAndNonEqualTypeArguments ()
+               {
+            const BindingFlags flags =
+                BindingFlags.IgnoreCase | BindingFlags.Instance |
+                BindingFlags.Static | BindingFlags.Public |
+                BindingFlags.FlattenHierarchy | BindingFlags.InvokeMethod;
+
+                       Assert.AreEqual ("foobarbaz", typeof (BinderTest).InvokeMember (
+                               "bug636939",
+                               flags,
+                               null, // binder
+                               null, // target
+                               new object [] { CultureInfo.CurrentCulture, "foo{0}{1}", "bar", "baz" }));
+               }
        }
 }