public override bool CanEvaluateToBool (Project context)
{
- return left.CanEvaluateToBool (context) && right.CanEvaluateToBool (context);
+ // Short-circuiting, check only left expr, right
+ // would be required only if left == true
+ return left.CanEvaluateToBool (context);
}
public override bool CanEvaluateToNumber (Project context)
Assert.AreEqual ("fr_c.txt", bgp [2].FinalItemSpec, "A4");
}
+ // Test shortcircuiting
+ [Test]
+ public void TestCondition12 ()
+ {
+ Engine engine = new Engine (Consts.BinPath);
+ Project proj = engine.CreateNewProject ();
+
+ string documentString = @"
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <PropertyGroup>
+ <A Condition=""'$(NonExistant)' != '' and $(NonExistant)""></A>
+ </PropertyGroup>
+ </Project>
+ ";
+
+ proj.LoadXml (documentString);
+
+ Assert.IsNull (proj.EvaluatedProperties ["A"], "A1");
+ }
+
+
[Test]
public void TestHasTrailingSlash1 ()
{