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

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

Issue 1847633002: Fix more strong mode errors in analyzer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix copied comment Created 4 years, 9 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/task/yaml.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 9fc01e2f679cacd8396356c1dcf7f1619c680482..4f1fee3d1d78a1cfad37201b66600448e130d839 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -3500,7 +3500,7 @@ class B = Object with A {}''',
void test_expressionList_multiple_end() {
List<Expression> result = parse4("parseExpressionList", ", 2, 3, 4",
- [ParserErrorCode.MISSING_IDENTIFIER]);
+ [ParserErrorCode.MISSING_IDENTIFIER]) as List<Expression>;
Bob Nystrom 2016/03/30 19:59:04 Do you think it might be worth making parse4() its
Brian Wilkerson 2016/03/31 00:23:11 I'm open to doing that if you want. Longer term I
expect(result, hasLength(4));
Expression syntheticExpression = result[0];
EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier,
@@ -3510,7 +3510,7 @@ class B = Object with A {}''',
void test_expressionList_multiple_middle() {
List<Expression> result = parse4("parseExpressionList", "1, 2, , 4",
- [ParserErrorCode.MISSING_IDENTIFIER]);
+ [ParserErrorCode.MISSING_IDENTIFIER]) as List<Expression>;
expect(result, hasLength(4));
Expression syntheticExpression = result[2];
EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier,
@@ -3520,7 +3520,7 @@ class B = Object with A {}''',
void test_expressionList_multiple_start() {
List<Expression> result = parse4("parseExpressionList", "1, 2, 3,",
- [ParserErrorCode.MISSING_IDENTIFIER]);
+ [ParserErrorCode.MISSING_IDENTIFIER]) as List<Expression>;
expect(result, hasLength(4));
Expression syntheticExpression = result[3];
EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier,
@@ -6067,7 +6067,8 @@ class SimpleParserTest extends ParserTestCase {
}
void test_parseCombinators_h() {
- List<Combinator> combinators = parse4("parseCombinators", "hide a;");
+ List<Combinator> combinators =
+ parse4("parseCombinators", "hide a;") as List<Combinator>;
expect(combinators, hasLength(1));
HideCombinator combinator = combinators[0] as HideCombinator;
expect(combinator, isNotNull);
@@ -6076,7 +6077,8 @@ class SimpleParserTest extends ParserTestCase {
}
void test_parseCombinators_hs() {
- List<Combinator> combinators = parse4("parseCombinators", "hide a show b;");
+ List<Combinator> combinators =
+ parse4("parseCombinators", "hide a show b;") as List<Combinator>;
expect(combinators, hasLength(2));
HideCombinator hideCombinator = combinators[0] as HideCombinator;
expect(hideCombinator, isNotNull);
@@ -6090,12 +6092,14 @@ class SimpleParserTest extends ParserTestCase {
void test_parseCombinators_hshs() {
List<Combinator> combinators =
- parse4("parseCombinators", "hide a show b hide c show d;");
+ parse4("parseCombinators", "hide a show b hide c show d;")
+ as List<Combinator>;
expect(combinators, hasLength(4));
}
void test_parseCombinators_s() {
- List<Combinator> combinators = parse4("parseCombinators", "show a;");
+ List<Combinator> combinators =
+ parse4("parseCombinators", "show a;") as List<Combinator>;
expect(combinators, hasLength(1));
ShowCombinator combinator = combinators[0] as ShowCombinator;
expect(combinator, isNotNull);
@@ -6256,7 +6260,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [bb] zzz */", 3);
List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[token];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
List<Token> tokenReferences = token.references;
expect(references, hasLength(2));
expect(tokenReferences, hasLength(2));
@@ -6288,7 +6293,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** [ some text", 5)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6303,7 +6309,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** [namePrefix some text", 5)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6320,7 +6327,8 @@ void''');
TokenType.SINGLE_LINE_COMMENT, "/// x [c]", 28)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(3));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6342,7 +6350,8 @@ void''');
"/**\n * a[i]\n * non-code line\n */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, isEmpty);
}
@@ -6354,7 +6363,8 @@ void''');
TokenType.SINGLE_LINE_COMMENT, "/// a[i] == b[i]", 0)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, isEmpty);
}
@@ -6364,7 +6374,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** [:xxx [a] yyy:] [b] zzz */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6378,7 +6389,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** `a[i]` and [b] */", 0)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6392,7 +6404,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** `a[i] and [b] */", 0)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(2));
}
@@ -6402,7 +6415,8 @@ void''');
"/**\n * a[i]\n * xxx [i] zzz\n */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6416,7 +6430,8 @@ void''');
"/** [a]: http://www.google.com (Google) [b] zzz */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6430,7 +6445,8 @@ void''');
"/** [a](http://www.google.com) [b] zzz */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -6444,7 +6460,8 @@ void''');
TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)
];
List<CommentReference> references =
- parse("parseCommentReferences", <Object>[tokens], "");
+ parse("parseCommentReferences", <Object>[tokens], "")
+ as List<CommentReference>;
expect(references, hasLength(1));
CommentReference reference = references[0];
expect(reference, isNotNull);
@@ -7405,12 +7422,14 @@ void''');
}
void test_parseExpressionList_multiple() {
- List<Expression> result = parse4("parseExpressionList", "1, 2, 3");
+ List<Expression> result =
+ parse4("parseExpressionList", "1, 2, 3") as List<Expression>;
expect(result, hasLength(3));
}
void test_parseExpressionList_single() {
- List<Expression> result = parse4("parseExpressionList", "1");
+ List<Expression> result =
+ parse4("parseExpressionList", "1") as List<Expression>;
expect(result, hasLength(1));
}
@@ -8365,12 +8384,14 @@ void''');
}
void test_parseIdentifierList_multiple() {
- List<SimpleIdentifier> list = parse4("parseIdentifierList", "a, b, c");
+ List<SimpleIdentifier> list =
+ parse4("parseIdentifierList", "a, b, c") as List<SimpleIdentifier>;
expect(list, hasLength(3));
}
void test_parseIdentifierList_single() {
- List<SimpleIdentifier> list = parse4("parseIdentifierList", "a");
+ List<SimpleIdentifier> list =
+ parse4("parseIdentifierList", "a") as List<SimpleIdentifier>;
expect(list, hasLength(1));
}
« no previous file with comments | « pkg/analyzer/lib/src/task/yaml.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698