Chromium Code Reviews| 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..0cea061319091d05572d567d33876ffa6f33d4f0 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,32 @@ void testBoolean() { |
| Expect.isFalse(expression.evaluate(environment)); |
| } |
| +void testNotBoolean() { |
| + var expression = |
| + Expression.parse(r" $arch == ia32 && ! $unchecked || $mode == release "); |
| + Expect.equals( |
| + r"((($arch == ia32) && (bool ! $unchecked)) || ($mode == release))", |
| + expression.toString()); |
| + |
| + var environment = <String, dynamic>{ |
|
Bob Nystrom
2017/06/01 23:07:46
This map needs to be wrapped in new TestEnvironmen
Lasse Reichstein Nielsen
2017/06/07 08:51:48
Done.
|
| + "arch": "ia32", |
| + "unchecked": false, |
|
Bob Nystrom
2017/06/01 23:07:45
Nit: Would you mind using "checked" for this?
It
Lasse Reichstein Nielsen
2017/06/07 08:51:48
Sure. This was just the "minimal diff" from the te
|
| + "mode": "debug" |
| + }; |
| + |
| + Expect.isTrue(expression.evaluate(environment)); |
| + environment["mode"] = "release"; |
| + Expect.isTrue(expression.evaluate(environment)); |
| + environment["unchecked"] = true; |
|
Bob Nystrom
2017/06/01 23:07:45
"true" and "false" need to be explicitly stringifi
Lasse Reichstein Nielsen
2017/06/07 08:51:48
Done.
|
| + Expect.isTrue(expression.evaluate(environment)); |
| + environment["mode"] = "debug"; |
| + Expect.isFalse(expression.evaluate(environment)); |
| + environment["arch"] = "arm"; |
| + Expect.isFalse(expression.evaluate(environment)); |
| + environment["unchecked"] = false; |
| + Expect.isFalse(expression.evaluate(environment)); |
| +} |
| + |
| void testNotEqual() { |
| // Test the != operator. |
| var expression = Expression.parse(r"$compiler == dart2js && $runtime != ie9"); |