Index: tests/standalone/status_expression_test.dart |
diff --git a/tests/standalone/status_expression_test.dart b/tests/standalone/status_expression_test.dart |
index a16c746d8d596c6b19063910600a296b60e53b0d..fbf7b1d696466d7dd0fa405e01d4f03ae60be308 100644 |
--- a/tests/standalone/status_expression_test.dart |
+++ b/tests/standalone/status_expression_test.dart |
@@ -22,6 +22,7 @@ main() { |
testExpression(); |
testSyntaxError(); |
testBoolean(); |
+ testNotBoolean(); |
testNotEqual(); |
} |
@@ -76,6 +77,29 @@ void testBoolean() { |
Expect.isFalse(expression.evaluate(environment)); |
} |
+void testNotBoolean() { |
+ var expression = |
+ Expression.parse(r" $arch == ia32 && ! $checked || $mode == release "); |
+ Expect.equals( |
+ r"((($arch == ia32) && (bool ! $checked)) || ($mode == release))", |
+ expression.toString()); |
+ |
+ var environment = new TestEnvironment( |
+ {"arch": "ia32", "checked": "false", "mode": "debug"}); |
+ |
+ Expect.isTrue(expression.evaluate(environment)); |
+ environment["mode"] = "release"; |
+ Expect.isTrue(expression.evaluate(environment)); |
+ environment["checked"] = "true"; |
+ Expect.isTrue(expression.evaluate(environment)); |
+ environment["mode"] = "debug"; |
+ Expect.isFalse(expression.evaluate(environment)); |
+ environment["arch"] = "arm"; |
+ Expect.isFalse(expression.evaluate(environment)); |
+ environment["checked"] = "false"; |
+ Expect.isFalse(expression.evaluate(environment)); |
+} |
+ |
void testNotEqual() { |
// Test the != operator. |
var expression = Expression.parse(r"$compiler == dart2js && $runtime != ie9"); |