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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
9 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 HighlightRegionType type = HighlightRegionType.IDENTIFIER_DEFAULT; | 1078 HighlightRegionType type = HighlightRegionType.IDENTIFIER_DEFAULT; |
1079 assertHasRegion(type, 'aaa()'); | 1079 assertHasRegion(type, 'aaa()'); |
1080 assertHasRegion(type, 'bbb()'); | 1080 assertHasRegion(type, 'bbb()'); |
1081 assertHasRegion(type, 'ccc()'); | 1081 assertHasRegion(type, 'ccc()'); |
1082 assertHasRegion(type, 'unresolved(1)'); | 1082 assertHasRegion(type, 'unresolved(1)'); |
1083 assertHasRegion(type, 'unresolved(2)'); | 1083 assertHasRegion(type, 'unresolved(2)'); |
1084 assertHasRegion(type, 'unresolved(3)'); | 1084 assertHasRegion(type, 'unresolved(3)'); |
1085 } | 1085 } |
1086 | 1086 |
1087 void _addLibraryForTestPart() { | 1087 void _addLibraryForTestPart() { |
1088 addFile( | 1088 addFile('$testFolder/my_lib.dart', ''' |
1089 '$testFolder/my_lib.dart', | |
1090 ''' | |
1091 library lib; | 1089 library lib; |
1092 part 'test.dart'; | 1090 part 'test.dart'; |
1093 '''); | 1091 '''); |
1094 } | 1092 } |
1095 } | 1093 } |
1096 | 1094 |
1097 @reflectiveTest | 1095 @reflectiveTest |
1098 class HighlightTypeTest { | 1096 class HighlightTypeTest { |
1099 void test_constructor() { | 1097 void test_constructor() { |
1100 expect(HighlightRegionType.CLASS, | 1098 expect(HighlightRegionType.CLASS, |
1101 new HighlightRegionType(HighlightRegionType.CLASS.name)); | 1099 new HighlightRegionType(HighlightRegionType.CLASS.name)); |
1102 } | 1100 } |
1103 | 1101 |
1104 void test_toString() { | 1102 void test_toString() { |
1105 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); | 1103 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); |
1106 } | 1104 } |
1107 | 1105 |
1108 void test_valueOf_unknown() { | 1106 void test_valueOf_unknown() { |
1109 expect(() { | 1107 expect(() { |
1110 new HighlightRegionType('no-such-type'); | 1108 new HighlightRegionType('no-such-type'); |
1111 }, throws); | 1109 }, throws); |
1112 } | 1110 } |
1113 } | 1111 } |
OLD | NEW |