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

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

Issue 1570183002: add parser parseAsync flag (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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/task/options.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | 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 0f43183782bffbe9b6ba5cdccc81468b95a7294f..5d304c70e61c4ea5fda64245c93b2b921b85c821 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -937,6 +937,18 @@ class ErrorParserTest extends ParserTestCase {
[ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
}
+ void test_enableAsync_false_1() {
+ parseAsync = false;
+ parse4("parseFunctionDeclarationStatement",
+ "foo() async {}", [ParserErrorCode.ASYNC_NOT_SUPPORTED]);
+ }
+
+ void test_enableAsync_false_2() {
+ parseAsync = false;
+ parse4("parseFunctionDeclarationStatement",
+ "foo() sync* {}", [ParserErrorCode.ASYNC_NOT_SUPPORTED]);
+ }
+
void test_emptyEnumBody() {
parse3("parseEnumDeclaration", <Object>[emptyCommentAndMetadata()],
"enum E {}", [ParserErrorCode.EMPTY_ENUM_BODY]);
@@ -2647,6 +2659,11 @@ class ParserTestCase extends EngineTestCase {
static bool parseFunctionBodies = true;
/**
+ * A flag indicating whether parser is to parse async.
+ */
+ bool parseAsync = true;
+
+ /**
* A flag indicating whether conditional directives support should be enabled
* for a specific test.
*/
@@ -2713,6 +2730,7 @@ class ParserTestCase extends EngineTestCase {
// Parse the source.
//
Parser parser = createParser(listener);
+ parser.parseAsync = parseAsync;
parser.parseConditionalDirectives = enableConditionalDirectives;
parser.parseGenericMethods = enableGenericMethods;
parser.parseGenericMethodComments = enableGenericMethodComments;
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698