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

Side by Side Diff: pkg/status_file/test/status_expression_test.dart

Issue 2984203002: Move the status file parser into its own package. (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 import "../../tools/testing/dart/environment.dart"; 7 import "package:status_file/environment.dart";
8 import "../../tools/testing/dart/status_expression.dart"; 8 import "package:status_file/src/expression.dart";
9 9
10 class TestEnvironment implements Environment { 10 class TestEnvironment implements Environment {
11 final Map<String, String> _values; 11 final Map<String, String> _values;
12 12
13 TestEnvironment(this._values); 13 TestEnvironment(this._values);
14 14
15 void validate(String name, String value, List<String> errors) {
16 throw new UnimplementedError();
17 }
18
15 /// Looks up the value of the variable with [name]. 19 /// Looks up the value of the variable with [name].
16 String lookUp(String name) => _values[name]; 20 String lookUp(String name) => _values[name];
17 21
18 operator []=(String key, String value) => _values[key] = value; 22 operator []=(String key, String value) => _values[key] = value;
19 } 23 }
20 24
21 main() { 25 main() {
22 testExpression(); 26 testExpression();
23 testSyntaxError(); 27 testSyntaxError();
24 testBoolean(); 28 testBoolean();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 Expect.isFalse(expression.evaluate(environment)); 119 Expect.isFalse(expression.evaluate(environment));
116 environment["runtime"] = "chrome"; 120 environment["runtime"] = "chrome";
117 Expect.isFalse(expression.evaluate(environment)); 121 Expect.isFalse(expression.evaluate(environment));
118 122
119 environment["compiler"] = "dart2js"; 123 environment["compiler"] = "dart2js";
120 environment["runtime"] = "ie9"; 124 environment["runtime"] = "ie9";
121 Expect.isFalse(expression.evaluate(environment)); 125 Expect.isFalse(expression.evaluate(environment));
122 environment["runtime"] = "chrome"; 126 environment["runtime"] = "chrome";
123 Expect.isTrue(expression.evaluate(environment)); 127 Expect.isTrue(expression.evaluate(environment));
124 } 128 }
OLDNEW
« no previous file with comments | « pkg/status_file/test/repo_status_files_test.dart ('k') | tests/standalone/io/status_file_parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698