Przeglądaj źródła

add failing test for bnc550722

svn path=/trunk/mcs/; revision=145829
Jb Evain 16 lat temu
rodzic
commit
7bcb3ffae0

+ 18 - 0
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Quote.cs

@@ -58,5 +58,23 @@ namespace MonoTests.System.Linq.Expressions
 
 			Assert.AreEqual (42, get42 ());
 		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void ParameterInQuotedExpression () // #550722
+		{
+			// Expression<Func<string, Expression<Func<string>>>> e = (string s) => () => s;
+
+			var s = Expression.Parameter (typeof (string), "s");
+
+			var lambda = Expression.Lambda<Func<string, Expression<Func<string>>>> (
+				Expression.Quote (
+					Expression.Lambda<Func<string>> (s, new ParameterExpression [0])),
+				s);
+
+			var fs = lambda.Compile () ("bingo").Compile ();
+
+			Assert.AreEqual ("bingo", fs ());
+		}
 	}
 }