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

Unified Diff: pkg/analyzer/test/src/task/dart_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/test/generated/parser_test.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index b81e72a709de5af3df5a99bc5c20e1ca15ce61c3..23930d8f14ac924597b5627ddaac4961025edd28 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -2993,6 +2993,41 @@ class B {}''');
expect(outputs[UNITS], hasLength(1));
}
+ test_perform_enableAsync_false() {
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+ options.enableAsync = false;
+ prepareAnalysisContext(options);
+ _performParseTask(r'''
+import 'dart:async';
+class B {void foo() async {}}''');
+ expect(outputs, hasLength(9));
+ expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1));
+ expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
+ _assertHasCore(outputs[IMPORTED_LIBRARIES], 2);
+ expect(outputs[INCLUDED_PARTS], hasLength(0));
+ expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1));
+ expect(outputs[PARSE_ERRORS], hasLength(1));
+ expect(outputs[PARSED_UNIT], isNotNull);
+ expect(outputs[SOURCE_KIND], SourceKind.LIBRARY);
+ expect(outputs[UNITS], hasLength(1));
+ }
+
+ test_perform_enableAsync_true() {
+ _performParseTask(r'''
+import 'dart:async';
+class B {void foo() async {}}''');
+ expect(outputs, hasLength(9));
+ expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1));
+ expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
+ _assertHasCore(outputs[IMPORTED_LIBRARIES], 2);
+ expect(outputs[INCLUDED_PARTS], hasLength(0));
+ expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1));
+ expect(outputs[PARSE_ERRORS], hasLength(0));
+ expect(outputs[PARSED_UNIT], isNotNull);
+ expect(outputs[SOURCE_KIND], SourceKind.LIBRARY);
+ expect(outputs[UNITS], hasLength(1));
+ }
+
test_perform_computeSourceKind_noDirectives_hasContainingLibrary() {
// Parse "lib.dart" to let the context know that "test.dart" is included.
computeResult(
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698