OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
(...skipping 11331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11342 } | 11342 } |
11343 | 11343 |
11344 void test_parseNonLabeledStatement_variableDeclaration_gftType() { | 11344 void test_parseNonLabeledStatement_variableDeclaration_gftType() { |
11345 createParser('int Function(int) v;'); | 11345 createParser('int Function(int) v;'); |
11346 Statement statement = parser.parseNonLabeledStatement(); | 11346 Statement statement = parser.parseNonLabeledStatement(); |
11347 expectNotNullIfNoErrors(statement); | 11347 expectNotNullIfNoErrors(statement); |
11348 listener.assertNoErrors(); | 11348 listener.assertNoErrors(); |
11349 } | 11349 } |
11350 | 11350 |
11351 void | 11351 void |
11352 test_parseNonLabeledStatement_variableDeclaration_gftType_functionReturnTy
pe() { | |
11353 createParser( | |
11354 'Function Function(int x1, {Function x}) Function<B extends core.int>(in
t x) l771;'); | |
11355 Statement statement = parser.parseNonLabeledStatement(); | |
11356 expectNotNullIfNoErrors(statement); | |
11357 listener.assertNoErrors(); | |
11358 } | |
11359 | |
11360 void | |
11361 test_parseNonLabeledStatement_variableDeclaration_gftType_gftReturnType()
{ | 11352 test_parseNonLabeledStatement_variableDeclaration_gftType_gftReturnType()
{ |
11362 createParser('Function(int) Function(int) v;'); | 11353 createParser('Function(int) Function(int) v;'); |
11363 Statement statement = parser.parseNonLabeledStatement(); | 11354 Statement statement = parser.parseNonLabeledStatement(); |
11364 expectNotNullIfNoErrors(statement); | 11355 expectNotNullIfNoErrors(statement); |
11365 listener.assertNoErrors(); | 11356 listener.assertNoErrors(); |
11366 } | 11357 } |
11367 | 11358 |
11368 void | 11359 void |
11369 test_parseNonLabeledStatement_variableDeclaration_gftType_gftReturnType2()
{ | |
11370 createParser('int Function(int) Function(int) v;'); | |
11371 Statement statement = parser.parseNonLabeledStatement(); | |
11372 expectNotNullIfNoErrors(statement); | |
11373 listener.assertNoErrors(); | |
11374 } | |
11375 | |
11376 void | |
11377 test_parseNonLabeledStatement_variableDeclaration_gftType_noReturnType() { | 11360 test_parseNonLabeledStatement_variableDeclaration_gftType_noReturnType() { |
11378 createParser('Function(int) v;'); | 11361 createParser('Function(int) v;'); |
11379 Statement statement = parser.parseNonLabeledStatement(); | 11362 Statement statement = parser.parseNonLabeledStatement(); |
11380 expectNotNullIfNoErrors(statement); | 11363 expectNotNullIfNoErrors(statement); |
11381 listener.assertNoErrors(); | 11364 listener.assertNoErrors(); |
11382 } | 11365 } |
11383 | 11366 |
11384 void test_parseNonLabeledStatement_variableDeclaration_gftType_returnType() { | 11367 void test_parseNonLabeledStatement_variableDeclaration_gftType_returnType() { |
11385 createParser('int Function<T>() v;'); | 11368 createParser('int Function<T>() v;'); |
11386 Statement statement = parser.parseNonLabeledStatement(); | 11369 Statement statement = parser.parseNonLabeledStatement(); |
11387 expectNotNullIfNoErrors(statement); | 11370 expectNotNullIfNoErrors(statement); |
11388 listener.assertNoErrors(); | 11371 listener.assertNoErrors(); |
11389 } | 11372 } |
11390 | 11373 |
11391 void | |
11392 test_parseNonLabeledStatement_variableDeclaration_gftType_voidReturnType()
{ | |
11393 createParser('void Function() v;'); | |
11394 Statement statement = parser.parseNonLabeledStatement(); | |
11395 expectNotNullIfNoErrors(statement); | |
11396 listener.assertNoErrors(); | |
11397 } | |
11398 | |
11399 void test_parseOptionalReturnType() { | 11374 void test_parseOptionalReturnType() { |
11400 // TODO(brianwilkerson) Implement tests for this method. | 11375 // TODO(brianwilkerson) Implement tests for this method. |
11401 } | 11376 } |
11402 | 11377 |
11403 void test_Parser() { | 11378 void test_Parser() { |
11404 expect(new Parser(null, null), isNotNull); | 11379 expect(new Parser(null, null), isNotNull); |
11405 } | 11380 } |
11406 | 11381 |
11407 void test_parseReturnStatement_noValue() { | 11382 void test_parseReturnStatement_noValue() { |
11408 createParser('return;'); | 11383 createParser('return;'); |
(...skipping 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14927 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 14902 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
14928 } | 14903 } |
14929 | 14904 |
14930 /** | 14905 /** |
14931 * Assert that the given [name] is in declaration context. | 14906 * Assert that the given [name] is in declaration context. |
14932 */ | 14907 */ |
14933 void _assertIsDeclarationName(SimpleIdentifier name) { | 14908 void _assertIsDeclarationName(SimpleIdentifier name) { |
14934 expect(name.inDeclarationContext(), isTrue); | 14909 expect(name.inDeclarationContext(), isTrue); |
14935 } | 14910 } |
14936 } | 14911 } |
OLD | NEW |