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

Unified Diff: pkg/analysis_server/test/analysis/notification_highlights_test.dart

Issue 668943004: Semantic highlight async/await/sync/yield. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/analysis_server/lib/src/computer/computer_highlights.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_highlights_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 7a548177525b0ab6eefcaeac43ef8cf4460d5c3d..a12add97ae529aacf41f1dfbb45ff3f58d89de5b 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -161,6 +161,32 @@ main() {
});
}
+ test_BUILT_IN_async() {
+ addTestFile('''
+fa() async {}
+fb() async* {}
+main() {
+ bool async = false;
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async');
+ assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async*');
+ assertNoRegion(HighlightRegionType.BUILT_IN, 'async = false');
+ });
+ }
+
+ test_BUILT_IN_await() {
+ addTestFile('''
+main() async {
+ await 42;
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasRegion(HighlightRegionType.BUILT_IN, 'await 42');
+ });
+ }
+
test_BUILT_IN_deferred() {
addTestFile('''
import 'dart:math' deferred as math;
@@ -400,6 +426,21 @@ main() {
});
}
+ test_BUILT_IN_sync() {
+ addTestFile('''
+fa() sync {}
+fb() sync* {}
+main() {
+ bool sync = false;
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasStringRegion(HighlightRegionType.BUILT_IN, 'sync');
+ assertHasStringRegion(HighlightRegionType.BUILT_IN, 'sync*');
+ assertNoRegion(HighlightRegionType.BUILT_IN, 'sync = false');
+ });
+ }
+
test_BUILT_IN_typedef() {
addTestFile('''
typedef A();
@@ -412,6 +453,28 @@ main() {
});
}
+ test_BUILT_IN_yield() {
+ addTestFile('''
+main() async* {
+ yield 42;
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasRegion(HighlightRegionType.BUILT_IN, 'yield 42');
+ });
+ }
+
+ test_BUILT_IN_yieldStar() {
+ addTestFile('''
+main() async* {
+ yield* [];
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasStringRegion(HighlightRegionType.BUILT_IN, 'yield*');
+ });
+ }
+
test_CLASS() {
addTestFile('''
class AAA {}
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698