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

Unified Diff: tests/standalone/status_expression_test.dart

Issue 15778003: Implement binary "!=" operator in status file parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | 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 03be619d10b60b48c5dc42299bfd686287eadfe2..7940c468ab52841a73301047810828d153bbbef9 100644
--- a/tests/standalone/status_expression_test.dart
+++ b/tests/standalone/status_expression_test.dart
@@ -16,6 +16,7 @@ class StatusExpressionTest {
test4();
test5();
test6();
+ test7();
}
static void test1() {
@@ -145,6 +146,33 @@ class StatusExpressionTest {
environment["checked"] = true;
Expect.isFalse(ast.evaluate(environment));
}
+
+ static void test7() {
+ // Test the != operator.
+ Tokenizer tokenizer =
+ new Tokenizer(r"$compiler == dart2js && $runtime != ie9");
+ tokenizer.tokenize();
+ ExpressionParser parser =
+ new ExpressionParser(new Scanner(tokenizer.tokens));
+ BooleanExpression ast = parser.parseBooleanExpression();
+ Expect.equals(r"(($compiler == dart2js) && ($runtime != ie9))",
+ ast.toString());
+
+ // Test BooleanExpression.evaluate().
+ Map environment = new Map();
+
+ environment["compiler"] = "none";
+ environment["runtime"] = "ie9";
+ Expect.isFalse(ast.evaluate(environment));
+ environment["runtime"] = "chrome";
+ Expect.isFalse(ast.evaluate(environment));
+
+ environment["compiler"] = "dart2js";
+ environment["runtime"] = "ie9";
+ Expect.isFalse(ast.evaluate(environment));
+ environment["runtime"] = "chrome";
+ Expect.isTrue(ast.evaluate(environment));
+ }
}
main() {
« no previous file with comments | « no previous file | tools/testing/dart/status_expression.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698