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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java

Issue 8382003: Can not find Element in Dynamic element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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
Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
index 6d789f330c59298fe482fd1bed795eb8af1b7ee1..c41d3a93773f6345eec25bea4582715c89184ad8 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
@@ -400,4 +400,31 @@ abstract class ResolverTestCase extends TestCase {
resolve(unit, ctx);
checkExpectedErrors(encountered, errorCodes, source);
}
+
+ /**
+ * Convenience method to parse and resolve a code snippet, without checking errors.
+ */
+ protected void resolve(String source) {
+ TestCompilerContext ctx = new TestCompilerContext() {
+ @Override
+ public void compilationError(DartCompilationError event) {
+ }
+ };
+ DartUnit unit = parseUnit(source);
+ resolve(unit, ctx);
+ }
+
+ /**
+ * Build a multi-line string from a list of strings.
+ *
+ * @param lines
+ * @return a single string containing {@code lines}, each terminated by \n
+ */
+ protected static String makeCode(String... lines) {
+ StringBuilder buf = new StringBuilder();
+ for (String line : lines) {
+ buf.append(line).append('\n');
+ }
+ return buf.toString();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698