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

Unified Diff: pkg/analyzer/test/generated/ast_test.dart

Issue 682553002: Convert most of the EngineTestCase.createSource invocations into multi-line String literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: pkg/analyzer/test/generated/ast_test.dart
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 7d19f0ca38b4ee1b2b253b65fd22754ae1e0c625..9d33f4ca026c441443cc00d13a47b46814ca4f13 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -60,25 +60,25 @@ class AssignmentKind extends Enum<AssignmentKind> {
class BreadthFirstVisitorTest extends ParserTestCase {
void test_it() {
- String source = EngineTestCase.createSource([
- "class A {",
- " bool get g => true;",
- "}",
- "class B {",
- " int f() {",
- " num q() {",
- " return 3;",
- " }",
- " return q() + 4;",
- " }",
- "}",
- "A f(var p) {",
- " if ((p as A).g) {",
- " return p;",
- " } else {",
- " return null;",
- " }",
- "}"]);
+ String source = r'''
+class A {
+ bool get g => true;
+}
+class B {
+ int f() {
+ num q() {
+ return 3;
+ }
+ return q() + 4;
+ }
+}
+A f(var p) {
+ if ((p as A).g) {
+ return p;
+ } else {
+ return null;
+ }
+}''';
CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []);
List<AstNode> nodes = new List<AstNode>();
BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_BreadthFirstVisitorTest_testIt(nodes);
@@ -805,14 +805,18 @@ class NodeLocatorTest extends ParserTestCase {
}
void test_searchWithin_offsetAfterNode() {
- CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+class A {}
+class B {}''', []);
NodeLocator locator = new NodeLocator.con2(1024, 1024);
AstNode node = locator.searchWithin(unit.declarations[0]);
JUnitTestCase.assertNull(node);
}
void test_searchWithin_offsetBeforeNode() {
- CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}", "class B {}"]), []);
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+class A {}
+class B {}''', []);
NodeLocator locator = new NodeLocator.con2(0, 0);
AstNode node = locator.searchWithin(unit.declarations[1]);
JUnitTestCase.assertNull(node);
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest.dart ('k') | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698