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

Side by Side Diff: pkg/analyzer_experimental/test/generated/ast_test.dart

Issue 18612009: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.ast_test; 3 library engine.ast_test;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'package:analyzer_experimental/src/generated/java_core.dart'; 5 import 'package:analyzer_experimental/src/generated/java_core.dart';
6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 6 import 'package:analyzer_experimental/src/generated/java_engine.dart';
7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 7 import 'package:analyzer_experimental/src/generated/java_junit.dart';
8 import 'package:analyzer_experimental/src/generated/source.dart'; 8 import 'package:analyzer_experimental/src/generated/source.dart';
9 import 'package:analyzer_experimental/src/generated/error.dart'; 9 import 'package:analyzer_experimental/src/generated/error.dart';
10 import 'package:analyzer_experimental/src/generated/scanner.dart'; 10 import 'package:analyzer_experimental/src/generated/scanner.dart';
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0); 710 static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0);
711 static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT' , 1); 711 static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT' , 1);
712 static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGH T', 2); 712 static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGH T', 2);
713 static final AssignmentKind POSTFIX_INC = new AssignmentKind('POSTFIX_INC', 3) ; 713 static final AssignmentKind POSTFIX_INC = new AssignmentKind('POSTFIX_INC', 3) ;
714 static final AssignmentKind PREFIX_DEC = new AssignmentKind('PREFIX_DEC', 4); 714 static final AssignmentKind PREFIX_DEC = new AssignmentKind('PREFIX_DEC', 4);
715 static final AssignmentKind PREFIX_INC = new AssignmentKind('PREFIX_INC', 5); 715 static final AssignmentKind PREFIX_INC = new AssignmentKind('PREFIX_INC', 5);
716 static final AssignmentKind PREFIX_NOT = new AssignmentKind('PREFIX_NOT', 6); 716 static final AssignmentKind PREFIX_NOT = new AssignmentKind('PREFIX_NOT', 6);
717 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ; 717 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ;
718 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8); 718 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8);
719 static final AssignmentKind NONE = new AssignmentKind('NONE', 9); 719 static final AssignmentKind NONE = new AssignmentKind('NONE', 9);
720 static final List<AssignmentKind> values = [BINARY, COMPOUND_LEFT, COMPOUND_RI GHT, POSTFIX_INC, PREFIX_DEC, PREFIX_INC, PREFIX_NOT, SIMPLE_LEFT, SIMPLE_RIGHT, NONE]; 720 static final List<AssignmentKind> values = [
721 BINARY,
722 COMPOUND_LEFT,
723 COMPOUND_RIGHT,
724 POSTFIX_INC,
725 PREFIX_DEC,
726 PREFIX_INC,
727 PREFIX_NOT,
728 SIMPLE_LEFT,
729 SIMPLE_RIGHT,
730 NONE];
721 731
722 /// The name of this enum constant, as declared in the enum declaration. 732 /// The name of this enum constant, as declared in the enum declaration.
723 final String name; 733 final String name;
724 734
725 /// The position in the enum declaration. 735 /// The position in the enum declaration.
726 final int ordinal; 736 final int ordinal;
727 AssignmentKind(this.name, this.ordinal); 737 AssignmentKind(this.name, this.ordinal);
728 int compareTo(AssignmentKind other) => ordinal - other.ordinal; 738 int compareTo(AssignmentKind other) => ordinal - other.ordinal;
729 int get hashCode => ordinal; 739 int get hashCode => ordinal;
730 String toString() => name; 740 String toString() => name;
731 } 741 }
732 class WrapperKind implements Comparable<WrapperKind> { 742 class WrapperKind implements Comparable<WrapperKind> {
733 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0); 743 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0);
734 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ; 744 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ;
735 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2); 745 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2);
736 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ; 746 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ;
737 static final WrapperKind NONE = new WrapperKind('NONE', 4); 747 static final WrapperKind NONE = new WrapperKind('NONE', 4);
738 static final List<WrapperKind> values = [PREFIXED_LEFT, PREFIXED_RIGHT, PROPER TY_LEFT, PROPERTY_RIGHT, NONE]; 748 static final List<WrapperKind> values = [
749 PREFIXED_LEFT,
750 PREFIXED_RIGHT,
751 PROPERTY_LEFT,
752 PROPERTY_RIGHT,
753 NONE];
739 754
740 /// The name of this enum constant, as declared in the enum declaration. 755 /// The name of this enum constant, as declared in the enum declaration.
741 final String name; 756 final String name;
742 757
743 /// The position in the enum declaration. 758 /// The position in the enum declaration.
744 final int ordinal; 759 final int ordinal;
745 WrapperKind(this.name, this.ordinal); 760 WrapperKind(this.name, this.ordinal);
746 int compareTo(WrapperKind other) => ordinal - other.ordinal; 761 int compareTo(WrapperKind other) => ordinal - other.ordinal;
747 int get hashCode => ordinal; 762 int get hashCode => ordinal;
748 String toString() => name; 763 String toString() => name;
749 } 764 }
750 class BreadthFirstVisitorTest extends ParserTestCase { 765 class BreadthFirstVisitorTest extends ParserTestCase {
751 void testIt() { 766 void testIt() {
752 String source = EngineTestCase.createSource(["class A {", " bool get g => t rue;", "}", "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;", " }", "}"]); 767 String source = EngineTestCase.createSource([
768 "class A {",
769 " bool get g => true;",
770 "}",
771 "class B {",
772 " int f() {",
773 " num q() {",
774 " return 3;",
775 " }",
776 " return q() + 4;",
777 " }",
778 "}",
779 "A f(var p) {",
780 " if ((p as A).g) {",
781 " return p;",
782 " } else {",
783 " return null;",
784 " }",
785 "}"]);
753 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []); 786 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []);
754 List<ASTNode> nodes = new List<ASTNode>(); 787 List<ASTNode> nodes = new List<ASTNode>();
755 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_15(nodes); 788 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_15(nodes);
756 visitor.visitAllNodes(unit); 789 visitor.visitAllNodes(unit);
757 EngineTestCase.assertSize(59, nodes); 790 EngineTestCase.assertSize(59, nodes);
758 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]); 791 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]);
759 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]); 792 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]);
760 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]); 793 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]);
761 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]); 794 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]);
762 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]); 795 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]);
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 void test_visitBooleanLiteral_true() { 1313 void test_visitBooleanLiteral_true() {
1281 assertSource("true", ASTFactory.booleanLiteral(true)); 1314 assertSource("true", ASTFactory.booleanLiteral(true));
1282 } 1315 }
1283 void test_visitBreakStatement_label() { 1316 void test_visitBreakStatement_label() {
1284 assertSource("break l;", ASTFactory.breakStatement2("l")); 1317 assertSource("break l;", ASTFactory.breakStatement2("l"));
1285 } 1318 }
1286 void test_visitBreakStatement_noLabel() { 1319 void test_visitBreakStatement_noLabel() {
1287 assertSource("break;", ASTFactory.breakStatement()); 1320 assertSource("break;", ASTFactory.breakStatement());
1288 } 1321 }
1289 void test_visitCascadeExpression_field() { 1322 void test_visitCascadeExpression_field() {
1290 assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier3( "a"), [ASTFactory.cascadedPropertyAccess("b"), ASTFactory.cascadedPropertyAccess ("c")])); 1323 assertSource("a..b..c", ASTFactory.cascadeExpression(ASTFactory.identifier3( "a"), [
1324 ASTFactory.cascadedPropertyAccess("b"),
1325 ASTFactory.cascadedPropertyAccess("c")]));
1291 } 1326 }
1292 void test_visitCascadeExpression_index() { 1327 void test_visitCascadeExpression_index() {
1293 assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)), ASTFactory .cascadedIndexExpression(ASTFactory.integer(1))])); 1328 assertSource("a..[0]..[1]", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [
1329 ASTFactory.cascadedIndexExpression(ASTFactory.integer(0)),
1330 ASTFactory.cascadedIndexExpression(ASTFactory.integer(1))]));
1294 } 1331 }
1295 void test_visitCascadeExpression_method() { 1332 void test_visitCascadeExpression_method() {
1296 assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [ASTFactory.cascadedMethodInvocation("b", []), ASTFactory.cascadedMeth odInvocation("c", [])])); 1333 assertSource("a..b()..c()", ASTFactory.cascadeExpression(ASTFactory.identifi er3("a"), [
1334 ASTFactory.cascadedMethodInvocation("b", []),
1335 ASTFactory.cascadedMethodInvocation("c", [])]));
1297 } 1336 }
1298 void test_visitCatchClause_catch_noStack() { 1337 void test_visitCatchClause_catch_noStack() {
1299 assertSource("catch (e) {}", ASTFactory.catchClause("e", [])); 1338 assertSource("catch (e) {}", ASTFactory.catchClause("e", []));
1300 } 1339 }
1301 void test_visitCatchClause_catch_stack() { 1340 void test_visitCatchClause_catch_stack() {
1302 assertSource("catch (e, s) {}", ASTFactory.catchClause2("e", "s", [])); 1341 assertSource("catch (e, s) {}", ASTFactory.catchClause2("e", "s", []));
1303 } 1342 }
1304 void test_visitCatchClause_on() { 1343 void test_visitCatchClause_on() {
1305 assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName4("E", [] ), [])); 1344 assertSource("on E {}", ASTFactory.catchClause3(ASTFactory.typeName4("E", [] ), []));
1306 } 1345 }
(...skipping 15 matching lines...) Expand all
1322 void test_visitClassDeclaration_extends_with() { 1361 void test_visitClassDeclaration_extends_with() {
1323 assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null , "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory .withClause([ASTFactory.typeName4("M", [])]), null, [])); 1362 assertSource("class C extends A with M {}", ASTFactory.classDeclaration(null , "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", [])), ASTFactory .withClause([ASTFactory.typeName4("M", [])]), null, []));
1324 } 1363 }
1325 void test_visitClassDeclaration_extends_with_implements() { 1364 void test_visitClassDeclaration_extends_with_implements() {
1326 assertSource("class C extends A with M implements B {}", ASTFactory.classDec laration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", []) ), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("B", [])]), [])); 1365 assertSource("class C extends A with M implements B {}", ASTFactory.classDec laration(null, "C", null, ASTFactory.extendsClause(ASTFactory.typeName4("A", []) ), ASTFactory.withClause([ASTFactory.typeName4("M", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("B", [])]), []));
1327 } 1366 }
1328 void test_visitClassDeclaration_implements() { 1367 void test_visitClassDeclaration_implements() {
1329 assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C ", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])] ), [])); 1368 assertSource("class C implements B {}", ASTFactory.classDeclaration(null, "C ", null, null, null, ASTFactory.implementsClause([ASTFactory.typeName4("B", [])] ), []));
1330 } 1369 }
1331 void test_visitClassDeclaration_multipleMember() { 1370 void test_visitClassDeclaration_multipleMember() {
1332 assertSource("class C {var a; var b;}", ASTFactory.classDeclaration(null, "C ", null, null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [AS TFactory.variableDeclaration("a")]), ASTFactory.fieldDeclaration2(false, Keyword .VAR, [ASTFactory.variableDeclaration("b")])])); 1371 assertSource("class C {var a; var b;}", ASTFactory.classDeclaration(null, "C ", null, null, null, null, [
1372 ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDec laration("a")]),
1373 ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactory.variableDec laration("b")])]));
1333 } 1374 }
1334 void test_visitClassDeclaration_parameters() { 1375 void test_visitClassDeclaration_parameters() {
1335 assertSource("class C<E> {}", ASTFactory.classDeclaration(null, "C", ASTFact ory.typeParameterList(["E"]), null, null, null, [])); 1376 assertSource("class C<E> {}", ASTFactory.classDeclaration(null, "C", ASTFact ory.typeParameterList(["E"]), null, null, null, []));
1336 } 1377 }
1337 void test_visitClassDeclaration_parameters_extends() { 1378 void test_visitClassDeclaration_parameters_extends() {
1338 assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C ", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.type Name4("A", [])), null, null, [])); 1379 assertSource("class C<E> extends A {}", ASTFactory.classDeclaration(null, "C ", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(ASTFactory.type Name4("A", [])), null, null, []));
1339 } 1380 }
1340 void test_visitClassDeclaration_parameters_extends_implements() { 1381 void test_visitClassDeclaration_parameters_extends_implements() {
1341 assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclara tion(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(AS TFactory.typeName4("A", [])), null, ASTFactory.implementsClause([ASTFactory.type Name4("B", [])]), [])); 1382 assertSource("class C<E> extends A implements B {}", ASTFactory.classDeclara tion(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsClause(AS TFactory.typeName4("A", [])), null, ASTFactory.implementsClause([ASTFactory.type Name4("B", [])]), []));
1342 } 1383 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 void test_visitConstructorDeclaration_const() { 1453 void test_visitConstructorDeclaration_const() {
1413 assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONS T, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([]))); 1454 assertSource("const C() {}", ASTFactory.constructorDeclaration2(Keyword.CONS T, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactory.blockFunctionBody([])));
1414 } 1455 }
1415 void test_visitConstructorDeclaration_external() { 1456 void test_visitConstructorDeclaration_external() {
1416 assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.i dentifier3("C"), null, ASTFactory.formalParameterList([]), null)); 1457 assertSource("external C();", ASTFactory.constructorDeclaration(ASTFactory.i dentifier3("C"), null, ASTFactory.formalParameterList([]), null));
1417 } 1458 }
1418 void test_visitConstructorDeclaration_minimal() { 1459 void test_visitConstructorDeclaration_minimal() {
1419 assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFac tory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactor y.blockFunctionBody([]))); 1460 assertSource("C() {}", ASTFactory.constructorDeclaration2(null, null, ASTFac tory.identifier3("C"), null, ASTFactory.formalParameterList([]), null, ASTFactor y.blockFunctionBody([])));
1420 } 1461 }
1421 void test_visitConstructorDeclaration_multipleInitializers() { 1462 void test_visitConstructorDeclaration_multipleInitializers() {
1422 assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(nul l, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory. identifier3("b")) as ConstructorInitializer), ASTFactory.constructorFieldInitial izer(false, "c", ASTFactory.identifier3("d"))]), ASTFactory.blockFunctionBody([] ))); 1463 assertSource("C() : a = b, c = d {}", ASTFactory.constructorDeclaration2(nul l, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFactory.list([
1464 (ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identifie r3("b")) as ConstructorInitializer),
1465 ASTFactory.constructorFieldInitializer(false, "c", ASTFactory.identifier 3("d"))]), ASTFactory.blockFunctionBody([])));
1423 } 1466 }
1424 void test_visitConstructorDeclaration_multipleParameters() { 1467 void test_visitConstructorDeclaration_multipleParameters() {
1425 assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([ASTFact ory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(Ke yword.VAR, "b")]), null, ASTFactory.blockFunctionBody([]))); 1468 assertSource("C(var a, var b) {}", ASTFactory.constructorDeclaration2(null, null, ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([
1469 ASTFactory.simpleFormalParameter(Keyword.VAR, "a"),
1470 ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), null, ASTFactory.b lockFunctionBody([])));
1426 } 1471 }
1427 void test_visitConstructorDeclaration_named() { 1472 void test_visitConstructorDeclaration_named() {
1428 assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTF actory.identifier3("C"), "m", ASTFactory.formalParameterList([]), null, ASTFacto ry.blockFunctionBody([]))); 1473 assertSource("C.m() {}", ASTFactory.constructorDeclaration2(null, null, ASTF actory.identifier3("C"), "m", ASTFactory.formalParameterList([]), null, ASTFacto ry.blockFunctionBody([])));
1429 } 1474 }
1430 void test_visitConstructorDeclaration_singleInitializer() { 1475 void test_visitConstructorDeclaration_singleInitializer() {
1431 assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null , ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFact ory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identif ier3("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([]))); 1476 assertSource("C() : a = b {}", ASTFactory.constructorDeclaration2(null, null , ASTFactory.identifier3("C"), null, ASTFactory.formalParameterList([]), ASTFact ory.list([(ASTFactory.constructorFieldInitializer(false, "a", ASTFactory.identif ier3("b")) as ConstructorInitializer)]), ASTFactory.blockFunctionBody([])));
1432 } 1477 }
1433 void test_visitConstructorFieldInitializer_withoutThis() { 1478 void test_visitConstructorFieldInitializer_withoutThis() {
1434 assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", AST Factory.identifier3("b"))); 1479 assertSource("a = b", ASTFactory.constructorFieldInitializer(false, "a", AST Factory.identifier3("b")));
1435 } 1480 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 void test_visitEmptyFunctionBody() { 1517 void test_visitEmptyFunctionBody() {
1473 assertSource(";", ASTFactory.emptyFunctionBody()); 1518 assertSource(";", ASTFactory.emptyFunctionBody());
1474 } 1519 }
1475 void test_visitEmptyStatement() { 1520 void test_visitEmptyStatement() {
1476 assertSource(";", ASTFactory.emptyStatement()); 1521 assertSource(";", ASTFactory.emptyStatement());
1477 } 1522 }
1478 void test_visitExportDirective_combinator() { 1523 void test_visitExportDirective_combinator() {
1479 assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart" , [(ASTFactory.showCombinator([ASTFactory.identifier3("A")]) as Combinator)])); 1524 assertSource("export 'a.dart' show A;", ASTFactory.exportDirective2("a.dart" , [(ASTFactory.showCombinator([ASTFactory.identifier3("A")]) as Combinator)]));
1480 } 1525 }
1481 void test_visitExportDirective_combinators() { 1526 void test_visitExportDirective_combinators() {
1482 assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2(" a.dart", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFactory.h ideCombinator([ASTFactory.identifier3("B")])])); 1527 assertSource("export 'a.dart' show A hide B;", ASTFactory.exportDirective2(" a.dart", [
1528 ASTFactory.showCombinator([ASTFactory.identifier3("A")]),
1529 ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
1483 } 1530 }
1484 void test_visitExportDirective_minimal() { 1531 void test_visitExportDirective_minimal() {
1485 assertSource("export 'a.dart';", ASTFactory.exportDirective2("a.dart", [])); 1532 assertSource("export 'a.dart';", ASTFactory.exportDirective2("a.dart", []));
1486 } 1533 }
1487 void test_visitExpressionFunctionBody() { 1534 void test_visitExpressionFunctionBody() {
1488 assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifie r3("a"))); 1535 assertSource("=> a;", ASTFactory.expressionFunctionBody(ASTFactory.identifie r3("a")));
1489 } 1536 }
1490 void test_visitExpressionStatement() { 1537 void test_visitExpressionStatement() {
1491 assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier3("a" ))); 1538 assertSource("a;", ASTFactory.expressionStatement(ASTFactory.identifier3("a" )));
1492 } 1539 }
(...skipping 21 matching lines...) Expand all
1514 void test_visitForEachStatement() { 1561 void test_visitForEachStatement() {
1515 assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.decla redIdentifier3("a"), ASTFactory.identifier3("b"), ASTFactory.block([]))); 1562 assertSource("for (a in b) {}", ASTFactory.forEachStatement(ASTFactory.decla redIdentifier3("a"), ASTFactory.identifier3("b"), ASTFactory.block([])));
1516 } 1563 }
1517 void test_visitFormalParameterList_empty() { 1564 void test_visitFormalParameterList_empty() {
1518 assertSource("()", ASTFactory.formalParameterList([])); 1565 assertSource("()", ASTFactory.formalParameterList([]));
1519 } 1566 }
1520 void test_visitFormalParameterList_n() { 1567 void test_visitFormalParameterList_n() {
1521 assertSource("({a : 0})", ASTFactory.formalParameterList([ASTFactory.namedFo rmalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0))])); 1568 assertSource("({a : 0})", ASTFactory.formalParameterList([ASTFactory.namedFo rmalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0))]));
1522 } 1569 }
1523 void test_visitFormalParameterList_nn() { 1570 void test_visitFormalParameterList_nn() {
1524 assertSource("({a : 0, b : 1})", ASTFactory.formalParameterList([ASTFactory. namedFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer( 0)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), AST Factory.integer(1))])); 1571 assertSource("({a : 0, b : 1})", ASTFactory.formalParameterList([
1572 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0)),
1573 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), ASTFactory.integer(1))]));
1525 } 1574 }
1526 void test_visitFormalParameterList_p() { 1575 void test_visitFormalParameterList_p() {
1527 assertSource("([a = 0])", ASTFactory.formalParameterList([ASTFactory.positio nalFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0) )])); 1576 assertSource("([a = 0])", ASTFactory.formalParameterList([ASTFactory.positio nalFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.integer(0) )]));
1528 } 1577 }
1529 void test_visitFormalParameterList_pp() { 1578 void test_visitFormalParameterList_pp() {
1530 assertSource("([a = 0, b = 1])", ASTFactory.formalParameterList([ASTFactory. positionalFormalParameter(ASTFactory.simpleFormalParameter3("a"), ASTFactory.int eger(0)), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3 ("b"), ASTFactory.integer(1))])); 1579 assertSource("([a = 0, b = 1])", ASTFactory.formalParameterList([
1580 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" a"), ASTFactory.integer(0)),
1581 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" b"), ASTFactory.integer(1))]));
1531 } 1582 }
1532 void test_visitFormalParameterList_r() { 1583 void test_visitFormalParameterList_r() {
1533 assertSource("(a)", ASTFactory.formalParameterList([ASTFactory.simpleFormalP arameter3("a")])); 1584 assertSource("(a)", ASTFactory.formalParameterList([ASTFactory.simpleFormalP arameter3("a")]));
1534 } 1585 }
1535 void test_visitFormalParameterList_rn() { 1586 void test_visitFormalParameterList_rn() {
1536 assertSource("(a, {b : 1})", ASTFactory.formalParameterList([ASTFactory.simp leFormalParameter3("a"), ASTFactory.namedFormalParameter(ASTFactory.simpleFormal Parameter3("b"), ASTFactory.integer(1))])); 1587 assertSource("(a, {b : 1})", ASTFactory.formalParameterList([
1588 ASTFactory.simpleFormalParameter3("a"),
1589 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), ASTFactory.integer(1))]));
1537 } 1590 }
1538 void test_visitFormalParameterList_rnn() { 1591 void test_visitFormalParameterList_rnn() {
1539 assertSource("(a, {b : 1, c : 2})", ASTFactory.formalParameterList([ASTFacto ry.simpleFormalParameter3("a"), ASTFactory.namedFormalParameter(ASTFactory.simpl eFormalParameter3("b"), ASTFactory.integer(1)), ASTFactory.namedFormalParameter( ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(2))])); 1592 assertSource("(a, {b : 1, c : 2})", ASTFactory.formalParameterList([
1593 ASTFactory.simpleFormalParameter3("a"),
1594 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("b"), ASTFactory.integer(1)),
1595 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(2))]));
1540 } 1596 }
1541 void test_visitFormalParameterList_rp() { 1597 void test_visitFormalParameterList_rp() {
1542 assertSource("(a, [b = 1])", ASTFactory.formalParameterList([ASTFactory.simp leFormalParameter3("a"), ASTFactory.positionalFormalParameter(ASTFactory.simpleF ormalParameter3("b"), ASTFactory.integer(1))])); 1598 assertSource("(a, [b = 1])", ASTFactory.formalParameterList([
1599 ASTFactory.simpleFormalParameter3("a"),
1600 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" b"), ASTFactory.integer(1))]));
1543 } 1601 }
1544 void test_visitFormalParameterList_rpp() { 1602 void test_visitFormalParameterList_rpp() {
1545 assertSource("(a, [b = 1, c = 2])", ASTFactory.formalParameterList([ASTFacto ry.simpleFormalParameter3("a"), ASTFactory.positionalFormalParameter(ASTFactory. simpleFormalParameter3("b"), ASTFactory.integer(1)), ASTFactory.positionalFormal Parameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(2))])); 1603 assertSource("(a, [b = 1, c = 2])", ASTFactory.formalParameterList([
1604 ASTFactory.simpleFormalParameter3("a"),
1605 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" b"), ASTFactory.integer(1)),
1606 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" c"), ASTFactory.integer(2))]));
1546 } 1607 }
1547 void test_visitFormalParameterList_rr() { 1608 void test_visitFormalParameterList_rr() {
1548 assertSource("(a, b)", ASTFactory.formalParameterList([ASTFactory.simpleForm alParameter3("a"), ASTFactory.simpleFormalParameter3("b")])); 1609 assertSource("(a, b)", ASTFactory.formalParameterList([
1610 ASTFactory.simpleFormalParameter3("a"),
1611 ASTFactory.simpleFormalParameter3("b")]));
1549 } 1612 }
1550 void test_visitFormalParameterList_rrn() { 1613 void test_visitFormalParameterList_rrn() {
1551 assertSource("(a, b, {c : 3})", ASTFactory.formalParameterList([ASTFactory.s impleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFactory.n amedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(3 ))])); 1614 assertSource("(a, b, {c : 3})", ASTFactory.formalParameterList([
1615 ASTFactory.simpleFormalParameter3("a"),
1616 ASTFactory.simpleFormalParameter3("b"),
1617 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(3))]));
1552 } 1618 }
1553 void test_visitFormalParameterList_rrnn() { 1619 void test_visitFormalParameterList_rrnn() {
1554 assertSource("(a, b, {c : 3, d : 4})", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.in teger(3)), ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("d" ), ASTFactory.integer(4))])); 1620 assertSource("(a, b, {c : 3, d : 4})", ASTFactory.formalParameterList([
1621 ASTFactory.simpleFormalParameter3("a"),
1622 ASTFactory.simpleFormalParameter3("b"),
1623 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.integer(3)),
1624 ASTFactory.namedFormalParameter(ASTFactory.simpleFormalParameter3("d"), ASTFactory.integer(4))]));
1555 } 1625 }
1556 void test_visitFormalParameterList_rrp() { 1626 void test_visitFormalParameterList_rrp() {
1557 assertSource("(a, b, [c = 3])", ASTFactory.formalParameterList([ASTFactory.s impleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFactory.p ositionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFactory.inte ger(3))])); 1627 assertSource("(a, b, [c = 3])", ASTFactory.formalParameterList([
1628 ASTFactory.simpleFormalParameter3("a"),
1629 ASTFactory.simpleFormalParameter3("b"),
1630 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" c"), ASTFactory.integer(3))]));
1558 } 1631 }
1559 void test_visitFormalParameterList_rrpp() { 1632 void test_visitFormalParameterList_rrpp() {
1560 assertSource("(a, b, [c = 3, d = 4])", ASTFactory.formalParameterList([ASTFa ctory.simpleFormalParameter3("a"), ASTFactory.simpleFormalParameter3("b"), ASTFa ctory.positionalFormalParameter(ASTFactory.simpleFormalParameter3("c"), ASTFacto ry.integer(3)), ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalPara meter3("d"), ASTFactory.integer(4))])); 1633 assertSource("(a, b, [c = 3, d = 4])", ASTFactory.formalParameterList([
1634 ASTFactory.simpleFormalParameter3("a"),
1635 ASTFactory.simpleFormalParameter3("b"),
1636 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" c"), ASTFactory.integer(3)),
1637 ASTFactory.positionalFormalParameter(ASTFactory.simpleFormalParameter3(" d"), ASTFactory.integer(4))]));
1561 } 1638 }
1562 void test_visitForStatement_c() { 1639 void test_visitForStatement_c() {
1563 assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier3("c"), null, ASTFactory.block([]))); 1640 assertSource("for (; c;) {}", ASTFactory.forStatement((null as Expression), ASTFactory.identifier3("c"), null, ASTFactory.block([])));
1564 } 1641 }
1565 void test_visitForStatement_cu() { 1642 void test_visitForStatement_cu() {
1566 assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression) , ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([]))); 1643 assertSource("for (; c; u) {}", ASTFactory.forStatement((null as Expression) , ASTFactory.identifier3("c"), ASTFactory.list([(ASTFactory.identifier3("u") as Expression)]), ASTFactory.block([])));
1567 } 1644 }
1568 void test_visitForStatement_e() { 1645 void test_visitForStatement_e() {
1569 assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier3( "e"), null, null, ASTFactory.block([]))); 1646 assertSource("for (e;;) {}", ASTFactory.forStatement(ASTFactory.identifier3( "e"), null, null, ASTFactory.block([])));
1570 } 1647 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 void test_visitFunctionTypedFormalParameter_type() { 1693 void test_visitFunctionTypedFormalParameter_type() {
1617 assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typ eName4("T", []), "f", [])); 1694 assertSource("T f()", ASTFactory.functionTypedFormalParameter(ASTFactory.typ eName4("T", []), "f", []));
1618 } 1695 }
1619 void test_visitIfStatement_withElse() { 1696 void test_visitIfStatement_withElse() {
1620 assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identif ier3("c"), ASTFactory.block([]), ASTFactory.block([]))); 1697 assertSource("if (c) {} else {}", ASTFactory.ifStatement2(ASTFactory.identif ier3("c"), ASTFactory.block([]), ASTFactory.block([])));
1621 } 1698 }
1622 void test_visitIfStatement_withoutElse() { 1699 void test_visitIfStatement_withoutElse() {
1623 assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier3("c") , ASTFactory.block([]))); 1700 assertSource("if (c) {}", ASTFactory.ifStatement(ASTFactory.identifier3("c") , ASTFactory.block([])));
1624 } 1701 }
1625 void test_visitImplementsClause_multiple() { 1702 void test_visitImplementsClause_multiple() {
1626 assertSource("implements A, B", ASTFactory.implementsClause([ASTFactory.type Name4("A", []), ASTFactory.typeName4("B", [])])); 1703 assertSource("implements A, B", ASTFactory.implementsClause([
1704 ASTFactory.typeName4("A", []),
1705 ASTFactory.typeName4("B", [])]));
1627 } 1706 }
1628 void test_visitImplementsClause_single() { 1707 void test_visitImplementsClause_single() {
1629 assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeNam e4("A", [])])); 1708 assertSource("implements A", ASTFactory.implementsClause([ASTFactory.typeNam e4("A", [])]));
1630 } 1709 }
1631 void test_visitImportDirective_combinator() { 1710 void test_visitImportDirective_combinator() {
1632 assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart" , null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")])])); 1711 assertSource("import 'a.dart' show A;", ASTFactory.importDirective2("a.dart" , null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
1633 } 1712 }
1634 void test_visitImportDirective_combinators() { 1713 void test_visitImportDirective_combinators() {
1635 assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2(" a.dart", null, [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), ASTFac tory.hideCombinator([ASTFactory.identifier3("B")])])); 1714 assertSource("import 'a.dart' show A hide B;", ASTFactory.importDirective2(" a.dart", null, [
1715 ASTFactory.showCombinator([ASTFactory.identifier3("A")]),
1716 ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
1636 } 1717 }
1637 void test_visitImportDirective_minimal() { 1718 void test_visitImportDirective_minimal() {
1638 assertSource("import 'a.dart';", ASTFactory.importDirective2("a.dart", null, [])); 1719 assertSource("import 'a.dart';", ASTFactory.importDirective2("a.dart", null, []));
1639 } 1720 }
1640 void test_visitImportDirective_prefix() { 1721 void test_visitImportDirective_prefix() {
1641 assertSource("import 'a.dart' as p;", ASTFactory.importDirective2("a.dart", "p", [])); 1722 assertSource("import 'a.dart' as p;", ASTFactory.importDirective2("a.dart", "p", []));
1642 } 1723 }
1643 void test_visitImportDirective_prefix_combinator() { 1724 void test_visitImportDirective_prefix_combinator() {
1644 assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a. dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")])])); 1725 assertSource("import 'a.dart' as p show A;", ASTFactory.importDirective2("a. dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")])]));
1645 } 1726 }
1646 void test_visitImportDirective_prefix_combinators() { 1727 void test_visitImportDirective_prefix_combinators() {
1647 assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirecti ve2("a.dart", "p", [ASTFactory.showCombinator([ASTFactory.identifier3("A")]), AS TFactory.hideCombinator([ASTFactory.identifier3("B")])])); 1728 assertSource("import 'a.dart' as p show A hide B;", ASTFactory.importDirecti ve2("a.dart", "p", [
1729 ASTFactory.showCombinator([ASTFactory.identifier3("A")]),
1730 ASTFactory.hideCombinator([ASTFactory.identifier3("B")])]));
1648 } 1731 }
1649 void test_visitImportHideCombinator_multiple() { 1732 void test_visitImportHideCombinator_multiple() {
1650 assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")])); 1733 assertSource("hide a, b", ASTFactory.hideCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")]));
1651 } 1734 }
1652 void test_visitImportHideCombinator_single() { 1735 void test_visitImportHideCombinator_single() {
1653 assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier3("a" )])); 1736 assertSource("hide a", ASTFactory.hideCombinator([ASTFactory.identifier3("a" )]));
1654 } 1737 }
1655 void test_visitImportShowCombinator_multiple() { 1738 void test_visitImportShowCombinator_multiple() {
1656 assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")])); 1739 assertSource("show a, b", ASTFactory.showCombinator([ASTFactory.identifier3( "a"), ASTFactory.identifier3("b")]));
1657 } 1740 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 void test_visitLabeledStatement_multiple() { 1777 void test_visitLabeledStatement_multiple() {
1695 assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([A STFactory.label2("a"), ASTFactory.label2("b")]), ASTFactory.returnStatement())); 1778 assertSource("a: b: return;", ASTFactory.labeledStatement(ASTFactory.list([A STFactory.label2("a"), ASTFactory.label2("b")]), ASTFactory.returnStatement()));
1696 } 1779 }
1697 void test_visitLabeledStatement_single() { 1780 void test_visitLabeledStatement_single() {
1698 assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTF actory.label2("a")]), ASTFactory.returnStatement())); 1781 assertSource("a: return;", ASTFactory.labeledStatement(ASTFactory.list([ASTF actory.label2("a")]), ASTFactory.returnStatement()));
1699 } 1782 }
1700 void test_visitLibraryDirective() { 1783 void test_visitLibraryDirective() {
1701 assertSource("library l;", ASTFactory.libraryDirective2("l")); 1784 assertSource("library l;", ASTFactory.libraryDirective2("l"));
1702 } 1785 }
1703 void test_visitLibraryIdentifier_multiple() { 1786 void test_visitLibraryIdentifier_multiple() {
1704 assertSource("a.b.c", ASTFactory.libraryIdentifier([ASTFactory.identifier3(" a"), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")])); 1787 assertSource("a.b.c", ASTFactory.libraryIdentifier([
1788 ASTFactory.identifier3("a"),
1789 ASTFactory.identifier3("b"),
1790 ASTFactory.identifier3("c")]));
1705 } 1791 }
1706 void test_visitLibraryIdentifier_single() { 1792 void test_visitLibraryIdentifier_single() {
1707 assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier3("a")] )); 1793 assertSource("a", ASTFactory.libraryIdentifier([ASTFactory.identifier3("a")] ));
1708 } 1794 }
1709 void test_visitListLiteral_const() { 1795 void test_visitListLiteral_const() {
1710 assertSource("const []", ASTFactory.listLiteral2(Keyword.CONST, null, [])); 1796 assertSource("const []", ASTFactory.listLiteral2(Keyword.CONST, null, []));
1711 } 1797 }
1712 void test_visitListLiteral_empty() { 1798 void test_visitListLiteral_empty() {
1713 assertSource("[]", ASTFactory.listLiteral([])); 1799 assertSource("[]", ASTFactory.listLiteral([]));
1714 } 1800 }
1715 void test_visitListLiteral_nonEmpty() { 1801 void test_visitListLiteral_nonEmpty() {
1716 assertSource("[a, b, c]", ASTFactory.listLiteral([ASTFactory.identifier3("a" ), ASTFactory.identifier3("b"), ASTFactory.identifier3("c")])); 1802 assertSource("[a, b, c]", ASTFactory.listLiteral([
1803 ASTFactory.identifier3("a"),
1804 ASTFactory.identifier3("b"),
1805 ASTFactory.identifier3("c")]));
1717 } 1806 }
1718 void test_visitMapLiteral_const() { 1807 void test_visitMapLiteral_const() {
1719 assertSource("const {}", ASTFactory.mapLiteral(Keyword.CONST, null, [])); 1808 assertSource("const {}", ASTFactory.mapLiteral(Keyword.CONST, null, []));
1720 } 1809 }
1721 void test_visitMapLiteral_empty() { 1810 void test_visitMapLiteral_empty() {
1722 assertSource("{}", ASTFactory.mapLiteral2([])); 1811 assertSource("{}", ASTFactory.mapLiteral2([]));
1723 } 1812 }
1724 void test_visitMapLiteral_nonEmpty() { 1813 void test_visitMapLiteral_nonEmpty() {
1725 assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([ASTFacto ry.mapLiteralEntry("a", ASTFactory.identifier3("a")), ASTFactory.mapLiteralEntry ("b", ASTFactory.identifier3("b")), ASTFactory.mapLiteralEntry("c", ASTFactory.i dentifier3("c"))])); 1814 assertSource("{'a' : a, 'b' : b, 'c' : c}", ASTFactory.mapLiteral2([
1815 ASTFactory.mapLiteralEntry("a", ASTFactory.identifier3("a")),
1816 ASTFactory.mapLiteralEntry("b", ASTFactory.identifier3("b")),
1817 ASTFactory.mapLiteralEntry("c", ASTFactory.identifier3("c"))]));
1726 } 1818 }
1727 void test_visitMapLiteralEntry() { 1819 void test_visitMapLiteralEntry() {
1728 assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifie r3("b"))); 1820 assertSource("'a' : b", ASTFactory.mapLiteralEntry("a", ASTFactory.identifie r3("b")));
1729 } 1821 }
1730 void test_visitMethodDeclaration_external() { 1822 void test_visitMethodDeclaration_external() {
1731 assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]))); 1823 assertSource("external m();", ASTFactory.methodDeclaration(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([])));
1732 } 1824 }
1733 void test_visitMethodDeclaration_external_returnType() { 1825 void test_visitMethodDeclaration_external_returnType() {
1734 assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactor y.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formal ParameterList([]))); 1826 assertSource("external T m();", ASTFactory.methodDeclaration(null, ASTFactor y.typeName4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formal ParameterList([])));
1735 } 1827 }
1736 void test_visitMethodDeclaration_getter() { 1828 void test_visitMethodDeclaration_getter() {
1737 assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.G ET, null, ASTFactory.identifier3("m"), null, ASTFactory.blockFunctionBody([]))); 1829 assertSource("get m {}", ASTFactory.methodDeclaration2(null, null, Keyword.G ET, null, ASTFactory.identifier3("m"), null, ASTFactory.blockFunctionBody([])));
1738 } 1830 }
1739 void test_visitMethodDeclaration_getter_returnType() { 1831 void test_visitMethodDeclaration_getter_returnType() {
1740 assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.ty peName4("T", []), Keyword.GET, null, ASTFactory.identifier3("m"), null, ASTFacto ry.blockFunctionBody([]))); 1832 assertSource("T get m {}", ASTFactory.methodDeclaration2(null, ASTFactory.ty peName4("T", []), Keyword.GET, null, ASTFactory.identifier3("m"), null, ASTFacto ry.blockFunctionBody([])));
1741 } 1833 }
1742 void test_visitMethodDeclaration_getter_seturnType() { 1834 void test_visitMethodDeclaration_getter_seturnType() {
1743 assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), Keyword.SET, null, ASTFactory.identifier3("m"), ASTFact ory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), A STFactory.blockFunctionBody([]))); 1835 assertSource("T set m(var v) {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), Keyword.SET, null, ASTFactory.identifier3("m"), ASTFact ory.formalParameterList([ASTFactory.simpleFormalParameter(Keyword.VAR, "v")]), A STFactory.blockFunctionBody([])));
1744 } 1836 }
1745 void test_visitMethodDeclaration_minimal() { 1837 void test_visitMethodDeclaration_minimal() {
1746 assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blo ckFunctionBody([]))); 1838 assertSource("m() {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([]), ASTFactory.blo ckFunctionBody([])));
1747 } 1839 }
1748 void test_visitMethodDeclaration_multipleParameters() { 1840 void test_visitMethodDeclaration_multipleParameters() {
1749 assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([ASTFac tory.simpleFormalParameter(Keyword.VAR, "a"), ASTFactory.simpleFormalParameter(K eyword.VAR, "b")]), ASTFactory.blockFunctionBody([]))); 1841 assertSource("m(var a, var b) {}", ASTFactory.methodDeclaration2(null, null, null, null, ASTFactory.identifier3("m"), ASTFactory.formalParameterList([
1842 ASTFactory.simpleFormalParameter(Keyword.VAR, "a"),
1843 ASTFactory.simpleFormalParameter(Keyword.VAR, "b")]), ASTFactory.blockFu nctionBody([])));
1750 } 1844 }
1751 void test_visitMethodDeclaration_operator() { 1845 void test_visitMethodDeclaration_operator() {
1752 assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, nu ll, Keyword.OPERATOR, ASTFactory.identifier3("+"), ASTFactory.formalParameterLis t([]), ASTFactory.blockFunctionBody([]))); 1846 assertSource("operator +() {}", ASTFactory.methodDeclaration2(null, null, nu ll, Keyword.OPERATOR, ASTFactory.identifier3("+"), ASTFactory.formalParameterLis t([]), ASTFactory.blockFunctionBody([])));
1753 } 1847 }
1754 void test_visitMethodDeclaration_operator_returnType() { 1848 void test_visitMethodDeclaration_operator_returnType() {
1755 assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), null, Keyword.OPERATOR, ASTFactory.identifier3("+"), AS TFactory.formalParameterList([]), ASTFactory.blockFunctionBody([]))); 1849 assertSource("T operator +() {}", ASTFactory.methodDeclaration2(null, ASTFac tory.typeName4("T", []), null, Keyword.OPERATOR, ASTFactory.identifier3("+"), AS TFactory.formalParameterList([]), ASTFactory.blockFunctionBody([])));
1756 } 1850 }
1757 void test_visitMethodDeclaration_returnType() { 1851 void test_visitMethodDeclaration_returnType() {
1758 assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.type Name4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParame terList([]), ASTFactory.blockFunctionBody([]))); 1852 assertSource("T m() {}", ASTFactory.methodDeclaration2(null, ASTFactory.type Name4("T", []), null, null, ASTFactory.identifier3("m"), ASTFactory.formalParame terList([]), ASTFactory.blockFunctionBody([])));
1759 } 1853 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 void test_visitSimpleFormalParameter_type() { 1927 void test_visitSimpleFormalParameter_type() {
1834 assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName4(" A", []), "a")); 1928 assertSource("A a", ASTFactory.simpleFormalParameter4(ASTFactory.typeName4(" A", []), "a"));
1835 } 1929 }
1836 void test_visitSimpleIdentifier() { 1930 void test_visitSimpleIdentifier() {
1837 assertSource("a", ASTFactory.identifier3("a")); 1931 assertSource("a", ASTFactory.identifier3("a"));
1838 } 1932 }
1839 void test_visitSimpleStringLiteral() { 1933 void test_visitSimpleStringLiteral() {
1840 assertSource("'a'", ASTFactory.string2("a")); 1934 assertSource("'a'", ASTFactory.string2("a"));
1841 } 1935 }
1842 void test_visitStringInterpolation() { 1936 void test_visitStringInterpolation() {
1843 assertSource("'a\${e}b'", ASTFactory.string([ASTFactory.interpolationString( "'a", "a"), ASTFactory.interpolationExpression(ASTFactory.identifier3("e")), AST Factory.interpolationString("b'", "b")])); 1937 assertSource("'a\${e}b'", ASTFactory.string([
1938 ASTFactory.interpolationString("'a", "a"),
1939 ASTFactory.interpolationExpression(ASTFactory.identifier3("e")),
1940 ASTFactory.interpolationString("b'", "b")]));
1844 } 1941 }
1845 void test_visitSuperConstructorInvocation() { 1942 void test_visitSuperConstructorInvocation() {
1846 assertSource("super()", ASTFactory.superConstructorInvocation([])); 1943 assertSource("super()", ASTFactory.superConstructorInvocation([]));
1847 } 1944 }
1848 void test_visitSuperConstructorInvocation_named() { 1945 void test_visitSuperConstructorInvocation_named() {
1849 assertSource("super.c()", ASTFactory.superConstructorInvocation2("c", [])); 1946 assertSource("super.c()", ASTFactory.superConstructorInvocation2("c", []));
1850 } 1947 }
1851 void test_visitSuperExpression() { 1948 void test_visitSuperExpression() {
1852 assertSource("super", ASTFactory.superExpression()); 1949 assertSource("super", ASTFactory.superExpression());
1853 } 1950 }
(...skipping 15 matching lines...) Expand all
1869 void test_visitSwitchDefault_multipleStatements() { 1966 void test_visitSwitchDefault_multipleStatements() {
1870 assertSource("default: {} {}", ASTFactory.switchDefault2([ASTFactory.block([ ]), ASTFactory.block([])])); 1967 assertSource("default: {} {}", ASTFactory.switchDefault2([ASTFactory.block([ ]), ASTFactory.block([])]));
1871 } 1968 }
1872 void test_visitSwitchDefault_noLabels() { 1969 void test_visitSwitchDefault_noLabels() {
1873 assertSource("default: {}", ASTFactory.switchDefault2([ASTFactory.block([])] )); 1970 assertSource("default: {}", ASTFactory.switchDefault2([ASTFactory.block([])] ));
1874 } 1971 }
1875 void test_visitSwitchDefault_singleLabel() { 1972 void test_visitSwitchDefault_singleLabel() {
1876 assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([AS TFactory.label2("l1")]), [ASTFactory.block([])])); 1973 assertSource("l1: default: {}", ASTFactory.switchDefault(ASTFactory.list([AS TFactory.label2("l1")]), [ASTFactory.block([])]));
1877 } 1974 }
1878 void test_visitSwitchStatement() { 1975 void test_visitSwitchStatement() {
1879 assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchState ment(ASTFactory.identifier3("a"), [ASTFactory.switchCase(ASTFactory.string2("b") , [ASTFactory.block([])]), ASTFactory.switchDefault2([ASTFactory.block([])])])); 1976 assertSource("switch (a) {case 'b': {} default: {}}", ASTFactory.switchState ment(ASTFactory.identifier3("a"), [
1977 ASTFactory.switchCase(ASTFactory.string2("b"), [ASTFactory.block([])]),
1978 ASTFactory.switchDefault2([ASTFactory.block([])])]));
1880 } 1979 }
1881 void test_visitSymbolLiteral_multiple() { 1980 void test_visitSymbolLiteral_multiple() {
1882 assertSource("#a.b.c", ASTFactory.symbolLiteral(["a", "b", "c"])); 1981 assertSource("#a.b.c", ASTFactory.symbolLiteral(["a", "b", "c"]));
1883 } 1982 }
1884 void test_visitSymbolLiteral_single() { 1983 void test_visitSymbolLiteral_single() {
1885 assertSource("#a", ASTFactory.symbolLiteral(["a"])); 1984 assertSource("#a", ASTFactory.symbolLiteral(["a"]));
1886 } 1985 }
1887 void test_visitThisExpression() { 1986 void test_visitThisExpression() {
1888 assertSource("this", ASTFactory.thisExpression()); 1987 assertSource("this", ASTFactory.thisExpression());
1889 } 1988 }
1890 void test_visitThrowStatement() { 1989 void test_visitThrowStatement() {
1891 assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier3(" e"))); 1990 assertSource("throw e", ASTFactory.throwExpression2(ASTFactory.identifier3(" e")));
1892 } 1991 }
1893 void test_visitTopLevelVariableDeclaration_multiple() { 1992 void test_visitTopLevelVariableDeclaration_multiple() {
1894 assertSource("var a;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])); 1993 assertSource("var a;", ASTFactory.topLevelVariableDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")]));
1895 } 1994 }
1896 void test_visitTopLevelVariableDeclaration_single() { 1995 void test_visitTopLevelVariableDeclaration_single() {
1897 assertSource("var a, b;", ASTFactory.topLevelVariableDeclaration2(Keyword.VA R, [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 1996 assertSource("var a, b;", ASTFactory.topLevelVariableDeclaration2(Keyword.VA R, [
1997 ASTFactory.variableDeclaration("a"),
1998 ASTFactory.variableDeclaration("b")]));
1898 } 1999 }
1899 void test_visitTryStatement_catch() { 2000 void test_visitTryStatement_catch() {
1900 assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]) , [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])])); 2001 assertSource("try {} on E {}", ASTFactory.tryStatement2(ASTFactory.block([]) , [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]));
1901 } 2002 }
1902 void test_visitTryStatement_catches() { 2003 void test_visitTryStatement_catches() {
1903 assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.b lock([]), [ASTFactory.catchClause3(ASTFactory.typeName4("E", []), []), ASTFactor y.catchClause3(ASTFactory.typeName4("F", []), [])])); 2004 assertSource("try {} on E {} on F {}", ASTFactory.tryStatement2(ASTFactory.b lock([]), [
2005 ASTFactory.catchClause3(ASTFactory.typeName4("E", []), []),
2006 ASTFactory.catchClause3(ASTFactory.typeName4("F", []), [])]));
1904 } 2007 }
1905 void test_visitTryStatement_catchFinally() { 2008 void test_visitTryStatement_catchFinally() {
1906 assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactor y.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]), ASTFactory.block([]))); 2009 assertSource("try {} on E {} finally {}", ASTFactory.tryStatement3(ASTFactor y.block([]), ASTFactory.list([ASTFactory.catchClause3(ASTFactory.typeName4("E", []), [])]), ASTFactory.block([])));
1907 } 2010 }
1908 void test_visitTryStatement_finally() { 2011 void test_visitTryStatement_finally() {
1909 assertSource("try {} finally {}", ASTFactory.tryStatement(ASTFactory.block([ ]), ASTFactory.block([]))); 2012 assertSource("try {} finally {}", ASTFactory.tryStatement(ASTFactory.block([ ]), ASTFactory.block([])));
1910 } 2013 }
1911 void test_visitTypeAlias_generic() { 2014 void test_visitTypeAlias_generic() {
1912 assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName4( "A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterLi st([]))); 2015 assertSource("typedef A F<B>();", ASTFactory.typeAlias(ASTFactory.typeName4( "A", []), "F", ASTFactory.typeParameterList(["B"]), ASTFactory.formalParameterLi st([])));
1913 } 2016 }
1914 void test_visitTypeAlias_nonGeneric() { 2017 void test_visitTypeAlias_nonGeneric() {
1915 assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName4("A" , []), "F", null, ASTFactory.formalParameterList([]))); 2018 assertSource("typedef A F();", ASTFactory.typeAlias(ASTFactory.typeName4("A" , []), "F", null, ASTFactory.formalParameterList([])));
1916 } 2019 }
1917 void test_visitTypeArgumentList_multiple() { 2020 void test_visitTypeArgumentList_multiple() {
1918 assertSource("<E, F>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E" , []), ASTFactory.typeName4("F", [])])); 2021 assertSource("<E, F>", ASTFactory.typeArgumentList([
2022 ASTFactory.typeName4("E", []),
2023 ASTFactory.typeName4("F", [])]));
1919 } 2024 }
1920 void test_visitTypeArgumentList_single() { 2025 void test_visitTypeArgumentList_single() {
1921 assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E", [ ])])); 2026 assertSource("<E>", ASTFactory.typeArgumentList([ASTFactory.typeName4("E", [ ])]));
1922 } 2027 }
1923 void test_visitTypeName_multipleArgs() { 2028 void test_visitTypeName_multipleArgs() {
1924 assertSource("C<D, E>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", []), ASTFactory.typeName4("E", [])])); 2029 assertSource("C<D, E>", ASTFactory.typeName4("C", [
2030 ASTFactory.typeName4("D", []),
2031 ASTFactory.typeName4("E", [])]));
1925 } 2032 }
1926 void test_visitTypeName_nestedArg() { 2033 void test_visitTypeName_nestedArg() {
1927 assertSource("C<D<E>>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [ASTFactory.typeName4("E", [])])])); 2034 assertSource("C<D<E>>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [ASTFactory.typeName4("E", [])])]));
1928 } 2035 }
1929 void test_visitTypeName_noArgs() { 2036 void test_visitTypeName_noArgs() {
1930 assertSource("C", ASTFactory.typeName4("C", [])); 2037 assertSource("C", ASTFactory.typeName4("C", []));
1931 } 2038 }
1932 void test_visitTypeName_singleArg() { 2039 void test_visitTypeName_singleArg() {
1933 assertSource("C<D>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [] )])); 2040 assertSource("C<D>", ASTFactory.typeName4("C", [ASTFactory.typeName4("D", [] )]));
1934 } 2041 }
1935 void test_visitTypeParameter_withExtends() { 2042 void test_visitTypeParameter_withExtends() {
1936 assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeNa me4("C", []))); 2043 assertSource("E extends C", ASTFactory.typeParameter2("E", ASTFactory.typeNa me4("C", [])));
1937 } 2044 }
1938 void test_visitTypeParameter_withoutExtends() { 2045 void test_visitTypeParameter_withoutExtends() {
1939 assertSource("E", ASTFactory.typeParameter("E")); 2046 assertSource("E", ASTFactory.typeParameter("E"));
1940 } 2047 }
1941 void test_visitTypeParameterList_multiple() { 2048 void test_visitTypeParameterList_multiple() {
1942 assertSource("<E, F>", ASTFactory.typeParameterList(["E", "F"])); 2049 assertSource("<E, F>", ASTFactory.typeParameterList(["E", "F"]));
1943 } 2050 }
1944 void test_visitTypeParameterList_single() { 2051 void test_visitTypeParameterList_single() {
1945 assertSource("<E>", ASTFactory.typeParameterList(["E"])); 2052 assertSource("<E>", ASTFactory.typeParameterList(["E"]));
1946 } 2053 }
1947 void test_visitVariableDeclaration_initialized() { 2054 void test_visitVariableDeclaration_initialized() {
1948 assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identi fier3("b"))); 2055 assertSource("a = b", ASTFactory.variableDeclaration2("a", ASTFactory.identi fier3("b")));
1949 } 2056 }
1950 void test_visitVariableDeclaration_uninitialized() { 2057 void test_visitVariableDeclaration_uninitialized() {
1951 assertSource("a", ASTFactory.variableDeclaration("a")); 2058 assertSource("a", ASTFactory.variableDeclaration("a"));
1952 } 2059 }
1953 void test_visitVariableDeclarationList_const_type() { 2060 void test_visitVariableDeclarationList_const_type() {
1954 assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONS T, ASTFactory.typeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFacto ry.variableDeclaration("b")])); 2061 assertSource("const C a, b", ASTFactory.variableDeclarationList(Keyword.CONS T, ASTFactory.typeName4("C", []), [
2062 ASTFactory.variableDeclaration("a"),
2063 ASTFactory.variableDeclaration("b")]));
1955 } 2064 }
1956 void test_visitVariableDeclarationList_final_noType() { 2065 void test_visitVariableDeclarationList_final_noType() {
1957 assertSource("final a, b", ASTFactory.variableDeclarationList2(Keyword.FINAL , [ASTFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 2066 assertSource("final a, b", ASTFactory.variableDeclarationList2(Keyword.FINAL , [
2067 ASTFactory.variableDeclaration("a"),
2068 ASTFactory.variableDeclaration("b")]));
1958 } 2069 }
1959 void test_visitVariableDeclarationList_type() { 2070 void test_visitVariableDeclarationList_type() {
1960 assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.t ypeName4("C", []), [ASTFactory.variableDeclaration("a"), ASTFactory.variableDecl aration("b")])); 2071 assertSource("C a, b", ASTFactory.variableDeclarationList(null, ASTFactory.t ypeName4("C", []), [
2072 ASTFactory.variableDeclaration("a"),
2073 ASTFactory.variableDeclaration("b")]));
1961 } 2074 }
1962 void test_visitVariableDeclarationList_var() { 2075 void test_visitVariableDeclarationList_var() {
1963 assertSource("var a, b", ASTFactory.variableDeclarationList2(Keyword.VAR, [A STFactory.variableDeclaration("a"), ASTFactory.variableDeclaration("b")])); 2076 assertSource("var a, b", ASTFactory.variableDeclarationList2(Keyword.VAR, [
2077 ASTFactory.variableDeclaration("a"),
2078 ASTFactory.variableDeclaration("b")]));
1964 } 2079 }
1965 void test_visitVariableDeclarationStatement() { 2080 void test_visitVariableDeclarationStatement() {
1966 assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactor y.typeName4("C", []), [ASTFactory.variableDeclaration("c")])); 2081 assertSource("C c;", ASTFactory.variableDeclarationStatement(null, ASTFactor y.typeName4("C", []), [ASTFactory.variableDeclaration("c")]));
1967 } 2082 }
1968 void test_visitWhileStatement() { 2083 void test_visitWhileStatement() {
1969 assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier 3("c"), ASTFactory.block([]))); 2084 assertSource("while (c) {}", ASTFactory.whileStatement(ASTFactory.identifier 3("c"), ASTFactory.block([])));
1970 } 2085 }
1971 void test_visitWithClause_multiple() { 2086 void test_visitWithClause_multiple() {
1972 assertSource("with A, B, C", ASTFactory.withClause([ASTFactory.typeName4("A" , []), ASTFactory.typeName4("B", []), ASTFactory.typeName4("C", [])])); 2087 assertSource("with A, B, C", ASTFactory.withClause([
2088 ASTFactory.typeName4("A", []),
2089 ASTFactory.typeName4("B", []),
2090 ASTFactory.typeName4("C", [])]));
1973 } 2091 }
1974 void test_visitWithClause_single() { 2092 void test_visitWithClause_single() {
1975 assertSource("with A", ASTFactory.withClause([ASTFactory.typeName4("A", [])] )); 2093 assertSource("with A", ASTFactory.withClause([ASTFactory.typeName4("A", [])] ));
1976 } 2094 }
1977 2095
1978 /** 2096 /**
1979 * Assert that a `ToSourceVisitor` will produce the expected source when visit ing the given 2097 * Assert that a `ToSourceVisitor` will produce the expected source when visit ing the given
1980 * node. 2098 * node.
1981 * 2099 *
1982 * @param expectedSource the source string that the visitor is expected to pro duce 2100 * @param expectedSource the source string that the visitor is expected to pro duce
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2975 } 3093 }
2976 main() { 3094 main() {
2977 ConstantEvaluatorTest.dartSuite(); 3095 ConstantEvaluatorTest.dartSuite();
2978 NodeLocatorTest.dartSuite(); 3096 NodeLocatorTest.dartSuite();
2979 ToSourceVisitorTest.dartSuite(); 3097 ToSourceVisitorTest.dartSuite();
2980 BreadthFirstVisitorTest.dartSuite(); 3098 BreadthFirstVisitorTest.dartSuite();
2981 IndexExpressionTest.dartSuite(); 3099 IndexExpressionTest.dartSuite();
2982 SimpleIdentifierTest.dartSuite(); 3100 SimpleIdentifierTest.dartSuite();
2983 VariableDeclarationTest.dartSuite(); 3101 VariableDeclarationTest.dartSuite();
2984 } 3102 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/scanner.dart ('k') | pkg/analyzer_experimental/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698