Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: tests/standalone/status_expression_test.dart

Issue 2913963002: Add negation to single-identifier tests in status files. (Closed)
Patch Set: Address comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/standalone.status ('k') | tools/testing/dart/status_expression.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « tests/standalone/standalone.status ('k') | tools/testing/dart/status_expression.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698