| 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 |
| 11352 test_parseNonLabeledStatement_variableDeclaration_gftType_gftReturnType()
{ | 11361 test_parseNonLabeledStatement_variableDeclaration_gftType_gftReturnType()
{ |
| 11353 createParser('Function(int) Function(int) v;'); | 11362 createParser('Function(int) Function(int) v;'); |
| 11354 Statement statement = parser.parseNonLabeledStatement(); | 11363 Statement statement = parser.parseNonLabeledStatement(); |
| 11355 expectNotNullIfNoErrors(statement); | 11364 expectNotNullIfNoErrors(statement); |
| 11356 listener.assertNoErrors(); | 11365 listener.assertNoErrors(); |
| 11357 } | 11366 } |
| 11358 | 11367 |
| 11359 void | 11368 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 |
| 11360 test_parseNonLabeledStatement_variableDeclaration_gftType_noReturnType() { | 11377 test_parseNonLabeledStatement_variableDeclaration_gftType_noReturnType() { |
| 11361 createParser('Function(int) v;'); | 11378 createParser('Function(int) v;'); |
| 11362 Statement statement = parser.parseNonLabeledStatement(); | 11379 Statement statement = parser.parseNonLabeledStatement(); |
| 11363 expectNotNullIfNoErrors(statement); | 11380 expectNotNullIfNoErrors(statement); |
| 11364 listener.assertNoErrors(); | 11381 listener.assertNoErrors(); |
| 11365 } | 11382 } |
| 11366 | 11383 |
| 11367 void test_parseNonLabeledStatement_variableDeclaration_gftType_returnType() { | 11384 void test_parseNonLabeledStatement_variableDeclaration_gftType_returnType() { |
| 11368 createParser('int Function<T>() v;'); | 11385 createParser('int Function<T>() v;'); |
| 11369 Statement statement = parser.parseNonLabeledStatement(); | 11386 Statement statement = parser.parseNonLabeledStatement(); |
| 11370 expectNotNullIfNoErrors(statement); | 11387 expectNotNullIfNoErrors(statement); |
| 11371 listener.assertNoErrors(); | 11388 listener.assertNoErrors(); |
| 11372 } | 11389 } |
| 11373 | 11390 |
| 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 |
| 11374 void test_parseOptionalReturnType() { | 11399 void test_parseOptionalReturnType() { |
| 11375 // TODO(brianwilkerson) Implement tests for this method. | 11400 // TODO(brianwilkerson) Implement tests for this method. |
| 11376 } | 11401 } |
| 11377 | 11402 |
| 11378 void test_Parser() { | 11403 void test_Parser() { |
| 11379 expect(new Parser(null, null), isNotNull); | 11404 expect(new Parser(null, null), isNotNull); |
| 11380 } | 11405 } |
| 11381 | 11406 |
| 11382 void test_parseReturnStatement_noValue() { | 11407 void test_parseReturnStatement_noValue() { |
| 11383 createParser('return;'); | 11408 createParser('return;'); |
| (...skipping 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14902 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 14927 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
| 14903 } | 14928 } |
| 14904 | 14929 |
| 14905 /** | 14930 /** |
| 14906 * Assert that the given [name] is in declaration context. | 14931 * Assert that the given [name] is in declaration context. |
| 14907 */ | 14932 */ |
| 14908 void _assertIsDeclarationName(SimpleIdentifier name) { | 14933 void _assertIsDeclarationName(SimpleIdentifier name) { |
| 14909 expect(name.inDeclarationContext(), isTrue); | 14934 expect(name.inDeclarationContext(), isTrue); |
| 14910 } | 14935 } |
| 14911 } | 14936 } |
| OLD | NEW |