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

Side by Side Diff: tests/standalone/src/StatusExpressionTest.dart

Issue 8775007: Allow varying case in the expected outcome (Pass, PASS). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/testing/dart/status_expression.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("StatusExpressionTest"); 5 #library("StatusExpressionTest");
6 6
7 #import("../../../tools/testing/dart/status_expression.dart"); 7 #import("../../../tools/testing/dart/status_expression.dart");
8 8
9 9
10 class StatusExpressionTest { 10 class StatusExpressionTest {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 static void test5() { 83 static void test5() {
84 Tokenizer tokenizer = new Tokenizer( 84 Tokenizer tokenizer = new Tokenizer(
85 @"Skip , Pass if $arch == dartc, Fail || Timeout if " + 85 @"Skip , Pass if $arch == dartc, Fail || Timeout if " +
86 @"$arch == chromium && $mode == release"); 86 @"$arch == chromium && $mode == release");
87 tokenizer.tokenize(); 87 tokenizer.tokenize();
88 ExpressionParser parser = 88 ExpressionParser parser =
89 new ExpressionParser(new Scanner(tokenizer.tokens)); 89 new ExpressionParser(new Scanner(tokenizer.tokens));
90 SetExpression ast = parser.parseSetExpression(); 90 SetExpression ast = parser.parseSetExpression();
91 Expect.equals( 91 Expect.equals(
92 @"((Skip || (Pass if ($arch == dartc))) || ((Fail || Timeout) " + 92 @"((skip || (pass if ($arch == dartc))) || ((fail || timeout) " +
93 @"if (($arch == chromium) && ($mode == release))))", 93 @"if (($arch == chromium) && ($mode == release))))",
94 ast.toString()); 94 ast.toString());
95 95
96 // Test SetExpression.evaluate(). 96 // Test SetExpression.evaluate().
97 Map environment = new Map(); 97 Map environment = new Map();
98 environment["arch"] = "ia32"; 98 environment["arch"] = "ia32";
99 environment["checked"] = true; 99 environment["checked"] = true;
100 environment["mode"] = "debug"; 100 environment["mode"] = "debug";
101 Set<String> result = ast.evaluate(environment); 101 Set<String> result = ast.evaluate(environment);
102 Expect.setEquals(["Skip"], result); 102 Expect.setEquals(["skip"], result);
103 103
104 environment["arch"] = "dartc"; 104 environment["arch"] = "dartc";
105 result = ast.evaluate(environment); 105 result = ast.evaluate(environment);
106 Expect.setEquals(["Skip", "Pass"], result); 106 Expect.setEquals(["skip", "pass"], result);
107 107
108 environment["arch"] = "chromium"; 108 environment["arch"] = "chromium";
109 result = ast.evaluate(environment); 109 result = ast.evaluate(environment);
110 Expect.setEquals(["Skip"], result); 110 Expect.setEquals(["skip"], result);
111 111
112 environment["mode"] = "release"; 112 environment["mode"] = "release";
113 result = ast.evaluate(environment); 113 result = ast.evaluate(environment);
114 Expect.setEquals(["Skip", "Fail", "Timeout"], result); 114 Expect.setEquals(["skip", "fail", "timeout"], result);
115 } 115 }
116 116
117 static void test6() { 117 static void test6() {
118 Tokenizer tokenizer = new Tokenizer( 118 Tokenizer tokenizer = new Tokenizer(
119 @" $arch == ia32 && $checked || $mode == release "); 119 @" $arch == ia32 && $checked || $mode == release ");
120 tokenizer.tokenize(); 120 tokenizer.tokenize();
121 ExpressionParser parser = 121 ExpressionParser parser =
122 new ExpressionParser(new Scanner(tokenizer.tokens)); 122 new ExpressionParser(new Scanner(tokenizer.tokens));
123 BooleanExpression ast = parser.parseBooleanExpression(); 123 BooleanExpression ast = parser.parseBooleanExpression();
124 Expect.equals( 124 Expect.equals(
(...skipping 15 matching lines...) Expand all
140 environment["arch"] = "arm"; 140 environment["arch"] = "arm";
141 Expect.isFalse(ast.evaluate(environment)); 141 Expect.isFalse(ast.evaluate(environment));
142 environment["checked"] = true; 142 environment["checked"] = true;
143 Expect.isFalse(ast.evaluate(environment)); 143 Expect.isFalse(ast.evaluate(environment));
144 } 144 }
145 } 145 }
146 146
147 main() { 147 main() {
148 StatusExpressionTest.testMain(); 148 StatusExpressionTest.testMain();
149 } 149 }
OLDNEW
« 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