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

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

Issue 1589663002: fixes #25407, generic list and map literal type comments (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 5d304c70e61c4ea5fda64245c93b2b921b85c821..097980a8630f7049abc74c439d558b84f482e51a 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -7334,6 +7334,16 @@ void''');
expect(literal.rightBracket, isNotNull);
}
+ void test_parseConstExpression_listLiteral_typed_genericComment() {
+ enableGenericMethodComments = true;
+ ListLiteral literal = parse4("parseConstExpression", "const /*<A>*/ []");
+ expect(literal.constKeyword, isNotNull);
+ expect(literal.typeArguments, isNotNull);
+ expect(literal.leftBracket, isNotNull);
+ expect(literal.elements, hasLength(0));
+ expect(literal.rightBracket, isNotNull);
+ }
+
void test_parseConstExpression_listLiteral_untyped() {
ListLiteral literal = parse4("parseConstExpression", "const []");
expect(literal.constKeyword, isNotNull);
@@ -7351,6 +7361,15 @@ void''');
expect(literal.typeArguments, isNotNull);
}
+ void test_parseConstExpression_mapLiteral_typed_genericComment() {
+ enableGenericMethodComments = true;
+ MapLiteral literal = parse4("parseConstExpression", "const /*<A, B>*/ {}");
+ expect(literal.leftBracket, isNotNull);
+ expect(literal.entries, hasLength(0));
+ expect(literal.rightBracket, isNotNull);
+ expect(literal.typeArguments, isNotNull);
+ }
+
void test_parseConstExpression_mapLiteral_untyped() {
MapLiteral literal = parse4("parseConstExpression", "const {}");
expect(literal.leftBracket, isNotNull);
@@ -9856,6 +9875,13 @@ void''');
expect(literal.typeArguments.arguments, hasLength(1));
}
+ void test_parsePrimaryExpression_listLiteral_typed_genericComment() {
+ enableGenericMethodComments = true;
+ ListLiteral literal = parse4("parsePrimaryExpression", "/*<A>*/[ ]");
+ expect(literal.typeArguments, isNotNull);
+ expect(literal.typeArguments.arguments, hasLength(1));
+ }
+
void test_parsePrimaryExpression_mapLiteral() {
MapLiteral literal = parse4("parsePrimaryExpression", "{}");
expect(literal, isNotNull);
@@ -9867,6 +9893,13 @@ void''');
expect(literal.typeArguments.arguments, hasLength(2));
}
+ void test_parsePrimaryExpression_mapLiteral_typed_genericComment() {
+ enableGenericMethodComments = true;
+ MapLiteral literal = parse4("parsePrimaryExpression", "/*<A, B>*/{}");
+ expect(literal.typeArguments, isNotNull);
+ expect(literal.typeArguments.arguments, hasLength(2));
+ }
+
void test_parsePrimaryExpression_new() {
InstanceCreationExpression expression =
parse4("parsePrimaryExpression", "new A()");
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698