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

Side by Side Diff: pkg/analysis_server/test/analysis/notification_highlights_test.dart

Issue 835953002: Fix for 'await' highlighting in for-each. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.analysis.notification.highlights; 5 library test.analysis.notification.highlights;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async'); 173 assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async');
174 assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async*'); 174 assertHasStringRegion(HighlightRegionType.BUILT_IN, 'async*');
175 assertNoRegion(HighlightRegionType.BUILT_IN, 'async = false'); 175 assertNoRegion(HighlightRegionType.BUILT_IN, 'async = false');
176 }); 176 });
177 } 177 }
178 178
179 test_BUILT_IN_await() { 179 test_BUILT_IN_await() {
180 addTestFile(''' 180 addTestFile('''
181 main() async { 181 main() async {
182 await 42; 182 await 42;
183 await for (var item in []) {
184 print(item);
185 }
183 } 186 }
184 '''); 187 ''');
185 return prepareHighlights().then((_) { 188 return prepareHighlights().then((_) {
186 assertHasRegion(HighlightRegionType.BUILT_IN, 'await 42'); 189 assertHasRegion(HighlightRegionType.BUILT_IN, 'await 42');
190 assertHasRegion(HighlightRegionType.BUILT_IN, 'await for');
187 }); 191 });
188 } 192 }
189 193
190 test_BUILT_IN_deferred() { 194 test_BUILT_IN_deferred() {
191 addTestFile(''' 195 addTestFile('''
192 import 'dart:math' deferred as math; 196 import 'dart:math' deferred as math;
193 main() { 197 main() {
194 var deferred = 42; 198 var deferred = 42;
195 }'''); 199 }''');
196 return prepareHighlights().then((_) { 200 return prepareHighlights().then((_) {
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 void test_toString() { 1028 void test_toString() {
1025 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); 1029 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS');
1026 } 1030 }
1027 1031
1028 void test_valueOf_unknown() { 1032 void test_valueOf_unknown() {
1029 expect(() { 1033 expect(() {
1030 new HighlightRegionType('no-such-type'); 1034 new HighlightRegionType('no-such-type');
1031 }, throws); 1035 }, throws);
1032 } 1036 }
1033 } 1037 }
OLDNEW
« 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