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

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

Issue 3004103002: Fix more of the Fasta tests (Closed)
Patch Set: add comment Created 3 years, 4 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/test/generated/parser_fasta_test.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 420eda027bab6a6c825a17806b74b6bc9268caec..e7687198bfb74211c9a6a0df36110a0137229023 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -10765,6 +10765,46 @@ class SimpleParserTest extends ParserTestCase with SimpleParserTestMixin {
expect(reference.offset, 15);
}
+ void test_parseFunctionBody_skip_block() {
+ ParserTestCase.parseFunctionBodies = false;
+ createParser('{}');
+ FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
+ expectNotNullIfNoErrors(functionBody);
+ listener.assertNoErrors();
+ expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ }
+
+ void test_parseFunctionBody_skip_block_invalid() {
+ ParserTestCase.parseFunctionBodies = false;
+ createParser('{');
+ FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
+ expectNotNullIfNoErrors(functionBody);
+ listener.assertErrorsWithCodes([
+ fe.Scanner.useFasta
+ ? ScannerErrorCode.EXPECTED_TOKEN
+ : ParserErrorCode.EXPECTED_TOKEN
+ ]);
+ expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ }
+
+ void test_parseFunctionBody_skip_blocks() {
+ ParserTestCase.parseFunctionBodies = false;
+ createParser('{ {} }');
+ FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
+ expectNotNullIfNoErrors(functionBody);
+ listener.assertNoErrors();
+ expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ }
+
+ void test_parseFunctionBody_skip_expression() {
+ ParserTestCase.parseFunctionBodies = false;
+ createParser('=> y;');
+ FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
+ expectNotNullIfNoErrors(functionBody);
+ listener.assertNoErrors();
+ expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ }
+
void test_Parser() {
expect(new Parser(null, null), isNotNull);
}
@@ -11751,46 +11791,6 @@ abstract class SimpleParserTestMixin implements AbstractParserTestCase {
expect(body.isSynchronous, isFalse);
}
- void test_parseFunctionBody_skip_block() {
- ParserTestCase.parseFunctionBodies = false;
- createParser('{}');
- FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
- expectNotNullIfNoErrors(functionBody);
- listener.assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
- }
-
- void test_parseFunctionBody_skip_block_invalid() {
- ParserTestCase.parseFunctionBodies = false;
- createParser('{');
- FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
- expectNotNullIfNoErrors(functionBody);
- listener.assertErrorsWithCodes([
- fe.Scanner.useFasta
- ? ScannerErrorCode.EXPECTED_TOKEN
- : ParserErrorCode.EXPECTED_TOKEN
- ]);
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
- }
-
- void test_parseFunctionBody_skip_blocks() {
- ParserTestCase.parseFunctionBodies = false;
- createParser('{ {} }');
- FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
- expectNotNullIfNoErrors(functionBody);
- listener.assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
- }
-
- void test_parseFunctionBody_skip_expression() {
- ParserTestCase.parseFunctionBodies = false;
- createParser('=> y;');
- FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
- expectNotNullIfNoErrors(functionBody);
- listener.assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
- }
-
void test_parseIdentifierList_multiple() {
createParser('a, b, c');
List<SimpleIdentifier> list = parser.parseIdentifierList();
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698