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

Unified Diff: tools/testing/dart/status_expression.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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 | « tools/publish_all_pkgs.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/status_expression.dart
diff --git a/tools/testing/dart/status_expression.dart b/tools/testing/dart/status_expression.dart
index 2ac072a0534198dd5b3e83dce711ed697b0881a2..934ce59d200fead3061435973737cf46413bab4f 100644
--- a/tools/testing/dart/status_expression.dart
+++ b/tools/testing/dart/status_expression.dart
@@ -229,13 +229,16 @@ class ExpressionParser {
if (scanner.current == Token.LEFT_PAREN) {
scanner.advance();
SetExpression value = parseSetExpression();
- Expect.equals(scanner.current, Token.RIGHT_PAREN,
- "Missing right parenthesis in expression");
+ if (scanner.current != Token.RIGHT_PAREN) {
+ throw new RuntimeError("Missing right parenthesis in expression");
+ }
scanner.advance();
return value;
}
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current),
- "Expected identifier in expression, got ${scanner.current}");
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) {
+ throw new RuntimeError(
+ "Expected identifier in expression, got ${scanner.current}");
+ }
SetExpression value = new SetConstant(scanner.current);
scanner.advance();
return value;
@@ -267,25 +270,32 @@ class ExpressionParser {
if (scanner.current == Token.LEFT_PAREN) {
scanner.advance();
BooleanExpression value = parseBooleanExpression();
- Expect.equals(scanner.current, Token.RIGHT_PAREN,
- "Missing right parenthesis in expression");
+ if (scanner.current != Token.RIGHT_PAREN) {
+ throw new RuntimeError("Missing right parenthesis in expression");
+ }
scanner.advance();
return value;
}
// The only atomic booleans are of the form $variable == value or the
// form $variable.
- Expect.equals(scanner.current, Token.DOLLAR_SYMBOL,
- "Expected \$ in expression, got ${scanner.current}");
+ if (scanner.current != Token.DOLLAR_SYMBOL) {
+ throw new RuntimeError(
+ "Expected \$ in expression, got ${scanner.current}");
+ }
scanner.advance();
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current),
- "Expected identifier in expression, got ${scanner.current}");
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) {
+ throw new RuntimeError(
+ "Expected identifier in expression, got ${scanner.current}");
+ }
TermVariable left = new TermVariable(scanner.current);
scanner.advance();
if (scanner.current == Token.EQUALS) {
scanner.advance();
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current),
- "Expected identifier in expression, got ${scanner.current}");
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) {
+ throw new RuntimeError(
+ "Expected identifier in expression, got ${scanner.current}");
+ }
TermConstant right = new TermConstant(scanner.current);
scanner.advance();
return new Comparison(left, right);
« no previous file with comments | « tools/publish_all_pkgs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698