|
|
@@ -106,5 +106,28 @@ namespace MonoTests.System.Linq.Expressions
|
|
|
Assert.IsTrue (n.IsLiftedToNull);
|
|
|
Assert.IsNull (n.Method);
|
|
|
}
|
|
|
+
|
|
|
+ [Test]
|
|
|
+ [Category ("NotWorking")]
|
|
|
+ public void CompileNotInt32 ()
|
|
|
+ {
|
|
|
+ var p = Expression.Parameter (typeof (int), "i");
|
|
|
+ var not = Expression.Lambda<Func<int, int>> (Expression.Not (p), p).Compile ();
|
|
|
+
|
|
|
+ Assert.AreEqual (-2, not (1));
|
|
|
+ Assert.AreEqual (-4, not (3));
|
|
|
+ Assert.AreEqual (2, not (-3));
|
|
|
+ }
|
|
|
+
|
|
|
+ [Test]
|
|
|
+ [Category ("NotWorking")]
|
|
|
+ public void CompileNotBool ()
|
|
|
+ {
|
|
|
+ var p = Expression.Parameter (typeof (bool), "i");
|
|
|
+ var not = Expression.Lambda<Func<bool, bool>> (Expression.Not (p), p).Compile ();
|
|
|
+
|
|
|
+ Assert.AreEqual (false, not (true));
|
|
|
+ Assert.AreEqual (true, not (false));
|
|
|
+ }
|
|
|
}
|
|
|
}
|