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

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

Issue 19590006: 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';
11 import 'package:analyzer_experimental/src/generated/ast.dart'; 11 import 'package:analyzer_experimental/src/generated/ast.dart';
12 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; 12 import 'package:analyzer_experimental/src/generated/utilities_dart.dart';
13 import 'package:analyzer_experimental/src/generated/element.dart' show ClassElem ent; 13 import 'package:analyzer_experimental/src/generated/element.dart' show ClassElem ent;
14 import 'package:unittest/unittest.dart' as _ut; 14 import 'package:unittest/unittest.dart' as _ut;
15 import 'parser_test.dart' show ParserTestCase; 15 import 'parser_test.dart' show ParserTestCase;
16 import 'test_support.dart'; 16 import 'test_support.dart';
17 import 'scanner_test.dart' show TokenFactory; 17 import 'scanner_test.dart' show TokenFactory;
18 class NodeLocatorTest extends ParserTestCase { 18 class NodeLocatorTest extends ParserTestCase {
19 void test_offset() { 19 void test_range() {
20 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
21 assertLocate2(unit, 4, 10, LibraryDirective);
22 }
23 void test_searchWithin_null() {
24 NodeLocator locator = new NodeLocator.con2(0, 0);
25 JUnitTestCase.assertNull(locator.searchWithin(null));
26 }
27 void test_searchWithin_offset() {
20 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []); 28 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
21 assertLocate(unit, 10, SimpleIdentifier); 29 assertLocate(unit, 10, SimpleIdentifier);
22 } 30 }
23 void test_offsetAfterNode() { 31 void test_searchWithin_offsetAfterNode() {
24 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr eateSource(["class A {}", "class B {}"]), []); 32 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr eateSource(["class A {}", "class B {}"]), []);
25 NodeLocator locator = new NodeLocator.con2(1024, 1024); 33 NodeLocator locator = new NodeLocator.con2(1024, 1024);
26 ASTNode node = locator.searchWithin(unit.declarations[0]); 34 ASTNode node = locator.searchWithin(unit.declarations[0]);
27 JUnitTestCase.assertNull(node); 35 JUnitTestCase.assertNull(node);
28 } 36 }
29 void test_offsetBeforeNode() { 37 void test_searchWithin_offsetBeforeNode() {
30 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr eateSource(["class A {}", "class B {}"]), []); 38 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr eateSource(["class A {}", "class B {}"]), []);
31 NodeLocator locator = new NodeLocator.con2(0, 0); 39 NodeLocator locator = new NodeLocator.con2(0, 0);
32 ASTNode node = locator.searchWithin(unit.declarations[1]); 40 ASTNode node = locator.searchWithin(unit.declarations[1]);
33 JUnitTestCase.assertNull(node); 41 JUnitTestCase.assertNull(node);
34 } 42 }
35 void test_range() {
36 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library myLib;", []);
37 assertLocate2(unit, 4, 10, LibraryDirective);
38 }
39 void assertLocate(CompilationUnit unit, int offset, Type expectedClass) { 43 void assertLocate(CompilationUnit unit, int offset, Type expectedClass) {
40 assertLocate2(unit, offset, offset, expectedClass); 44 assertLocate2(unit, offset, offset, expectedClass);
41 } 45 }
42 void assertLocate2(CompilationUnit unit, int start, int end, Type expectedClas s) { 46 void assertLocate2(CompilationUnit unit, int start, int end, Type expectedClas s) {
43 NodeLocator locator = new NodeLocator.con2(start, end); 47 NodeLocator locator = new NodeLocator.con2(start, end);
44 ASTNode node = locator.searchWithin(unit); 48 ASTNode node = locator.searchWithin(unit);
45 JUnitTestCase.assertNotNull(node); 49 JUnitTestCase.assertNotNull(node);
50 JUnitTestCase.assertSame(node, locator.foundNode);
46 JUnitTestCase.assertTrueMsg("Node starts after range", node.offset <= start) ; 51 JUnitTestCase.assertTrueMsg("Node starts after range", node.offset <= start) ;
47 JUnitTestCase.assertTrueMsg("Node ends before range", node.offset + node.len gth > end); 52 JUnitTestCase.assertTrueMsg("Node ends before range", node.offset + node.len gth > end);
48 EngineTestCase.assertInstanceOf(expectedClass, node); 53 EngineTestCase.assertInstanceOf(expectedClass, node);
49 } 54 }
50 static dartSuite() { 55 static dartSuite() {
51 _ut.group('NodeLocatorTest', () { 56 _ut.group('NodeLocatorTest', () {
52 _ut.test('test_offset', () {
53 final __test = new NodeLocatorTest();
54 runJUnitTest(__test, __test.test_offset);
55 });
56 _ut.test('test_offsetAfterNode', () {
57 final __test = new NodeLocatorTest();
58 runJUnitTest(__test, __test.test_offsetAfterNode);
59 });
60 _ut.test('test_offsetBeforeNode', () {
61 final __test = new NodeLocatorTest();
62 runJUnitTest(__test, __test.test_offsetBeforeNode);
63 });
64 _ut.test('test_range', () { 57 _ut.test('test_range', () {
65 final __test = new NodeLocatorTest(); 58 final __test = new NodeLocatorTest();
66 runJUnitTest(__test, __test.test_range); 59 runJUnitTest(__test, __test.test_range);
67 }); 60 });
61 _ut.test('test_searchWithin_null', () {
62 final __test = new NodeLocatorTest();
63 runJUnitTest(__test, __test.test_searchWithin_null);
64 });
65 _ut.test('test_searchWithin_offset', () {
66 final __test = new NodeLocatorTest();
67 runJUnitTest(__test, __test.test_searchWithin_offset);
68 });
69 _ut.test('test_searchWithin_offsetAfterNode', () {
70 final __test = new NodeLocatorTest();
71 runJUnitTest(__test, __test.test_searchWithin_offsetAfterNode);
72 });
73 _ut.test('test_searchWithin_offsetBeforeNode', () {
74 final __test = new NodeLocatorTest();
75 runJUnitTest(__test, __test.test_searchWithin_offsetBeforeNode);
76 });
68 }); 77 });
69 } 78 }
70 } 79 }
71 class IndexExpressionTest extends EngineTestCase { 80 class IndexExpressionTest extends EngineTestCase {
72 void test_inGetterContext_assignment_compound_left() { 81 void test_inGetterContext_assignment_compound_left() {
73 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b")); 82 IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifie r3("a"), ASTFactory.identifier3("b"));
74 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null); 83 ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
75 JUnitTestCase.assertTrue(expression.inGetterContext()); 84 JUnitTestCase.assertTrue(expression.inGetterContext());
76 } 85 }
77 void test_inGetterContext_assignment_simple_left() { 86 void test_inGetterContext_assignment_simple_left() {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral.full(keyword == null ? null : T okenFactory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CU RLY_BRACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)) ; 352 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral.full(keyword == null ? null : T okenFactory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CU RLY_BRACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)) ;
344 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries); 353 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries);
345 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value); 354 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value);
346 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyw ord.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnTyp e, property == null ? null : TokenFactory.token(property), operator == null ? nu ll : TokenFactory.token(operator), name, parameters, emptyFunctionBody()); 355 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyw ord.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnTyp e, property == null ? null : TokenFactory.token(property), operator == null ? nu ll : TokenFactory.token(operator), name, parameters, emptyFunctionBody());
347 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration.full(null, null, nul l, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFa ctory.token(operator), name, parameters, body); 356 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration.full(null, null, nul l, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFa ctory.token(operator), name, parameters, body);
348 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argume ntList(arguments)); 357 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argume ntList(arguments));
349 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments); 358 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments);
350 static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression.full(label, expression); 359 static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression.full(label, expression);
351 static NamedExpression namedExpression2(String label, Expression expression) = > namedExpression(label2(label), expression); 360 static NamedExpression namedExpression2(String label, Expression expression) = > namedExpression(label2(label), expression);
352 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter.full(parameter, Param eterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON) , expression); 361 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter.full(parameter, Param eterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON) , expression);
362 static NativeClause nativeClause(String nativeCode) => new NativeClause.full(T okenFactory.token2("native"), string2(nativeCode));
353 static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new N ativeFunctionBody.full(TokenFactory.token2("native"), string2(nativeMethodName), TokenFactory.token3(TokenType.SEMICOLON)); 363 static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new N ativeFunctionBody.full(TokenFactory.token2("native"), string2(nativeMethodName), TokenFactory.token3(TokenType.SEMICOLON));
354 static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Ke yword.NULL)); 364 static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Ke yword.NULL));
355 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), e xpression, TokenFactory.token3(TokenType.CLOSE_PAREN)); 365 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), e xpression, TokenFactory.token3(TokenType.CLOSE_PAREN));
356 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2( url), TokenFactory.token3(TokenType.SEMICOLON)); 366 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2( url), TokenFactory.token3(TokenType.SEMICOLON));
357 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url); 367 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url);
358 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName); 368 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName);
359 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective.full(null, metadata, TokenFactory.tok en(Keyword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(To kenType.SEMICOLON)); 369 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective.full(null, metadata, TokenFactory.tok en(Keyword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(To kenType.SEMICOLON));
360 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenT ype.EQ), expression); 370 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenT ype.EQ), expression);
361 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression.full(expression, TokenFactory.token3(operator)) ; 371 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression.full(expression, TokenFactory.token3(operator)) ;
362 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression.full(TokenFactory.token3(operator), expression); 372 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression.full(TokenFactory.token3(operator), expression);
363 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD ), propertyName); 373 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD ), propertyName);
364 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identi fier3(propertyName)); 374 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identi fier3(propertyName));
365 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments); 375 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments);
366 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifi er3(constructorName), argumentList(arguments)); 376 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifi er3(constructorName), argumentList(arguments));
377 static RethrowExpression rethrowExpression() => new RethrowExpression.full(Tok enFactory.token(Keyword.RETHROW));
367 static ReturnStatement returnStatement() => returnStatement2(null); 378 static ReturnStatement returnStatement() => returnStatement2(null);
368 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3 (TokenType.SEMICOLON)); 379 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3 (TokenType.SEMICOLON));
369 static ScriptTag scriptTag(String scriptTag2) => new ScriptTag.full(TokenFacto ry.token2(scriptTag2)); 380 static ScriptTag scriptTag(String scriptTag2) => new ScriptTag.full(TokenFacto ry.token2(scriptTag2));
370 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator.full(TokenFactory.token2("show"), list(identifiers)); 381 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator.full(TokenFactory.token2("show"), list(identifiers));
371 static ShowCombinator showCombinator2(List<String> identifiers) { 382 static ShowCombinator showCombinator2(List<String> identifiers) {
372 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>(); 383 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
373 for (String identifier in identifiers) { 384 for (String identifier in identifiers) {
374 identifierList.add(identifier3(identifier)); 385 identifierList.add(identifier3(identifier));
375 } 386 }
376 return new ShowCombinator.full(TokenFactory.token2("show"), identifierList); 387 return new ShowCombinator.full(TokenFactory.token2("show"), identifierList);
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 } 1876 }
1866 void test_visitMethodInvocation_target() { 1877 void test_visitMethodInvocation_target() {
1867 assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier3("t" ), "m", [])); 1878 assertSource("t.m()", ASTFactory.methodInvocation(ASTFactory.identifier3("t" ), "m", []));
1868 } 1879 }
1869 void test_visitNamedExpression() { 1880 void test_visitNamedExpression() {
1870 assertSource("a: b", ASTFactory.namedExpression2("a", ASTFactory.identifier3 ("b"))); 1881 assertSource("a: b", ASTFactory.namedExpression2("a", ASTFactory.identifier3 ("b")));
1871 } 1882 }
1872 void test_visitNamedFormalParameter() { 1883 void test_visitNamedFormalParameter() {
1873 assertSource("var a : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleF ormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0))); 1884 assertSource("var a : 0", ASTFactory.namedFormalParameter(ASTFactory.simpleF ormalParameter(Keyword.VAR, "a"), ASTFactory.integer(0)));
1874 } 1885 }
1886 void test_visitNativeClause() {
1887 assertSource("native 'code'", ASTFactory.nativeClause("code"));
1888 }
1875 void test_visitNativeFunctionBody() { 1889 void test_visitNativeFunctionBody() {
1876 assertSource("native 'str';", ASTFactory.nativeFunctionBody("str")); 1890 assertSource("native 'str';", ASTFactory.nativeFunctionBody("str"));
1877 } 1891 }
1878 void test_visitNullLiteral() { 1892 void test_visitNullLiteral() {
1879 assertSource("null", ASTFactory.nullLiteral()); 1893 assertSource("null", ASTFactory.nullLiteral());
1880 } 1894 }
1881 void test_visitParenthesizedExpression() { 1895 void test_visitParenthesizedExpression() {
1882 assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier 3("a"))); 1896 assertSource("(a)", ASTFactory.parenthesizedExpression(ASTFactory.identifier 3("a")));
1883 } 1897 }
1884 void test_visitPartDirective() { 1898 void test_visitPartDirective() {
(...skipping 16 matching lines...) Expand all
1901 } 1915 }
1902 void test_visitPropertyAccess() { 1916 void test_visitPropertyAccess() {
1903 assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b")); 1917 assertSource("a.b", ASTFactory.propertyAccess2(ASTFactory.identifier3("a"), "b"));
1904 } 1918 }
1905 void test_visitRedirectingConstructorInvocation_named() { 1919 void test_visitRedirectingConstructorInvocation_named() {
1906 assertSource("this.c()", ASTFactory.redirectingConstructorInvocation2("c", [ ])); 1920 assertSource("this.c()", ASTFactory.redirectingConstructorInvocation2("c", [ ]));
1907 } 1921 }
1908 void test_visitRedirectingConstructorInvocation_unnamed() { 1922 void test_visitRedirectingConstructorInvocation_unnamed() {
1909 assertSource("this()", ASTFactory.redirectingConstructorInvocation([])); 1923 assertSource("this()", ASTFactory.redirectingConstructorInvocation([]));
1910 } 1924 }
1925 void test_visitRethrowExpression() {
1926 assertSource("rethrow", ASTFactory.rethrowExpression());
1927 }
1911 void test_visitReturnStatement_expression() { 1928 void test_visitReturnStatement_expression() {
1912 assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier3 ("a"))); 1929 assertSource("return a;", ASTFactory.returnStatement2(ASTFactory.identifier3 ("a")));
1913 } 1930 }
1914 void test_visitReturnStatement_noExpression() { 1931 void test_visitReturnStatement_noExpression() {
1915 assertSource("return;", ASTFactory.returnStatement()); 1932 assertSource("return;", ASTFactory.returnStatement());
1916 } 1933 }
1917 void test_visitScriptTag() { 1934 void test_visitScriptTag() {
1918 String scriptTag = "!#/bin/dart.exe"; 1935 String scriptTag = "!#/bin/dart.exe";
1919 assertSource(scriptTag, ASTFactory.scriptTag(scriptTag)); 1936 assertSource(scriptTag, ASTFactory.scriptTag(scriptTag));
1920 } 1937 }
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
2821 runJUnitTest(__test, __test.test_visitMethodInvocation_target); 2838 runJUnitTest(__test, __test.test_visitMethodInvocation_target);
2822 }); 2839 });
2823 _ut.test('test_visitNamedExpression', () { 2840 _ut.test('test_visitNamedExpression', () {
2824 final __test = new ToSourceVisitorTest(); 2841 final __test = new ToSourceVisitorTest();
2825 runJUnitTest(__test, __test.test_visitNamedExpression); 2842 runJUnitTest(__test, __test.test_visitNamedExpression);
2826 }); 2843 });
2827 _ut.test('test_visitNamedFormalParameter', () { 2844 _ut.test('test_visitNamedFormalParameter', () {
2828 final __test = new ToSourceVisitorTest(); 2845 final __test = new ToSourceVisitorTest();
2829 runJUnitTest(__test, __test.test_visitNamedFormalParameter); 2846 runJUnitTest(__test, __test.test_visitNamedFormalParameter);
2830 }); 2847 });
2848 _ut.test('test_visitNativeClause', () {
2849 final __test = new ToSourceVisitorTest();
2850 runJUnitTest(__test, __test.test_visitNativeClause);
2851 });
2831 _ut.test('test_visitNativeFunctionBody', () { 2852 _ut.test('test_visitNativeFunctionBody', () {
2832 final __test = new ToSourceVisitorTest(); 2853 final __test = new ToSourceVisitorTest();
2833 runJUnitTest(__test, __test.test_visitNativeFunctionBody); 2854 runJUnitTest(__test, __test.test_visitNativeFunctionBody);
2834 }); 2855 });
2835 _ut.test('test_visitNullLiteral', () { 2856 _ut.test('test_visitNullLiteral', () {
2836 final __test = new ToSourceVisitorTest(); 2857 final __test = new ToSourceVisitorTest();
2837 runJUnitTest(__test, __test.test_visitNullLiteral); 2858 runJUnitTest(__test, __test.test_visitNullLiteral);
2838 }); 2859 });
2839 _ut.test('test_visitParenthesizedExpression', () { 2860 _ut.test('test_visitParenthesizedExpression', () {
2840 final __test = new ToSourceVisitorTest(); 2861 final __test = new ToSourceVisitorTest();
(...skipping 28 matching lines...) Expand all
2869 runJUnitTest(__test, __test.test_visitPropertyAccess); 2890 runJUnitTest(__test, __test.test_visitPropertyAccess);
2870 }); 2891 });
2871 _ut.test('test_visitRedirectingConstructorInvocation_named', () { 2892 _ut.test('test_visitRedirectingConstructorInvocation_named', () {
2872 final __test = new ToSourceVisitorTest(); 2893 final __test = new ToSourceVisitorTest();
2873 runJUnitTest(__test, __test.test_visitRedirectingConstructorInvocation_n amed); 2894 runJUnitTest(__test, __test.test_visitRedirectingConstructorInvocation_n amed);
2874 }); 2895 });
2875 _ut.test('test_visitRedirectingConstructorInvocation_unnamed', () { 2896 _ut.test('test_visitRedirectingConstructorInvocation_unnamed', () {
2876 final __test = new ToSourceVisitorTest(); 2897 final __test = new ToSourceVisitorTest();
2877 runJUnitTest(__test, __test.test_visitRedirectingConstructorInvocation_u nnamed); 2898 runJUnitTest(__test, __test.test_visitRedirectingConstructorInvocation_u nnamed);
2878 }); 2899 });
2900 _ut.test('test_visitRethrowExpression', () {
2901 final __test = new ToSourceVisitorTest();
2902 runJUnitTest(__test, __test.test_visitRethrowExpression);
2903 });
2879 _ut.test('test_visitReturnStatement_expression', () { 2904 _ut.test('test_visitReturnStatement_expression', () {
2880 final __test = new ToSourceVisitorTest(); 2905 final __test = new ToSourceVisitorTest();
2881 runJUnitTest(__test, __test.test_visitReturnStatement_expression); 2906 runJUnitTest(__test, __test.test_visitReturnStatement_expression);
2882 }); 2907 });
2883 _ut.test('test_visitReturnStatement_noExpression', () { 2908 _ut.test('test_visitReturnStatement_noExpression', () {
2884 final __test = new ToSourceVisitorTest(); 2909 final __test = new ToSourceVisitorTest();
2885 runJUnitTest(__test, __test.test_visitReturnStatement_noExpression); 2910 runJUnitTest(__test, __test.test_visitReturnStatement_noExpression);
2886 }); 2911 });
2887 _ut.test('test_visitScriptTag', () { 2912 _ut.test('test_visitScriptTag', () {
2888 final __test = new ToSourceVisitorTest(); 2913 final __test = new ToSourceVisitorTest();
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 } 3118 }
3094 main() { 3119 main() {
3095 ConstantEvaluatorTest.dartSuite(); 3120 ConstantEvaluatorTest.dartSuite();
3096 NodeLocatorTest.dartSuite(); 3121 NodeLocatorTest.dartSuite();
3097 ToSourceVisitorTest.dartSuite(); 3122 ToSourceVisitorTest.dartSuite();
3098 BreadthFirstVisitorTest.dartSuite(); 3123 BreadthFirstVisitorTest.dartSuite();
3099 IndexExpressionTest.dartSuite(); 3124 IndexExpressionTest.dartSuite();
3100 SimpleIdentifierTest.dartSuite(); 3125 SimpleIdentifierTest.dartSuite();
3101 VariableDeclarationTest.dartSuite(); 3126 VariableDeclarationTest.dartSuite();
3102 } 3127 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/source.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