| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |