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

Unified Diff: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java

Issue 9073004: Fixes typo in NegativeParserTest and updates test to check for warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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 | « no previous file | compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
index f7dfe4b495c3cc142d8eeafd776316e69b9bd059..ca89628071d860791c0c1acab323b799acefdf7f 100644
--- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
@@ -4,6 +4,8 @@
package com.google.dart.compiler;
+import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
+
import com.google.common.collect.Lists;
import com.google.dart.compiler.CommandLineOptions.CompilerOptions;
import com.google.dart.compiler.ast.DartInvocation;
@@ -13,7 +15,6 @@ import com.google.dart.compiler.ast.DartNodeTraverser;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.common.ErrorExpectation;
-import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
import com.google.dart.compiler.parser.DartParser;
import com.google.dart.compiler.parser.DartParserRunner;
import com.google.dart.compiler.parser.DartScannerParserContext;
@@ -306,6 +307,14 @@ public abstract class CompilerTestCase extends TestCase {
}
/**
+ * Parses given source and checks parsing problems.
+ */
+ protected final void parseExpectWarnings(String code, ErrorExpectation... expectedWarnings) {
+ DartParserRunner runner = DartParserRunner.parse(getName(), code, Integer.MAX_VALUE, true);
+ List<DartCompilationError> errors = runner.getErrors();
+ assertErrors(errors, expectedWarnings);
+ }
+ /**
* @return the {@link DartInvocation} with given source. This is inaccurate approach, but good
* enough for specific tests.
*/
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698