Index: tests/standalone/status_expression_test.dart |
diff --git a/tests/standalone/status_expression_test.dart b/tests/standalone/status_expression_test.dart |
index 870670674ad5f7984f993eb63e555bb88962b311..98429ae5cbf922eb70082fd220b494a73c1e71d6 100644 |
--- a/tests/standalone/status_expression_test.dart |
+++ b/tests/standalone/status_expression_test.dart |
@@ -2,11 +2,22 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-library StatusExpressionTest; |
- |
import "package:expect/expect.dart"; |
+ |
+import "../../tools/testing/dart/environment.dart"; |
import "../../tools/testing/dart/status_expression.dart"; |
+class TestEnvironment implements Environment { |
+ final Map<String, String> _values; |
+ |
+ TestEnvironment(this._values); |
+ |
+ /// Looks up the value of the variable with [name]. |
+ String lookUp(String name) => _values[name]; |
+ |
+ operator []=(String key, String value) => _values[key] = value; |
+} |
+ |
main() { |
testExpression(); |
testSyntaxError(); |
@@ -22,7 +33,7 @@ void testExpression() { |
expression.toString()); |
// Test BooleanExpression.evaluate(). |
- var environment = <String, dynamic>{"arch": "dartc", "mode": "debug"}; |
+ var environment = new TestEnvironment({"arch": "dartc", "mode": "debug"}); |
Expect.isTrue(expression.evaluate(environment)); |
environment["mode"] = "release"; |
@@ -49,11 +60,8 @@ void testBoolean() { |
expression.toString()); |
// Test BooleanExpression.evaluate(). |
- var environment = <String, dynamic>{ |
- "arch": "ia32", |
- "checked": true, |
- "mode": "debug" |
- }; |
+ var environment = |
+ new TestEnvironment({"arch": "ia32", "checked": "true", "mode": "debug"}); |
Expect.isTrue(expression.evaluate(environment)); |
environment["mode"] = "release"; |
@@ -75,10 +83,10 @@ void testNotEqual() { |
r"(($compiler == dart2js) && ($runtime != ie9))", expression.toString()); |
// Test BooleanExpression.evaluate(). |
- var environment = <String, dynamic>{ |
+ var environment = new TestEnvironment({ |
"compiler": "none", |
"runtime": "ie9", |
- }; |
+ }); |
Expect.isFalse(expression.evaluate(environment)); |
environment["runtime"] = "chrome"; |