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

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

Issue 1352843002: Highlight library identifiers as LIBRARY_NAME. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights2.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.highlights2; 5 library test.analysis.notification.highlights2;
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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 break myLabel; 814 break myLabel;
815 } 815 }
816 } 816 }
817 '''); 817 ''');
818 return prepareHighlights().then((_) { 818 return prepareHighlights().then((_) {
819 assertHasRegion(HighlightRegionType.LABEL, 'myLabel:'); 819 assertHasRegion(HighlightRegionType.LABEL, 'myLabel:');
820 assertHasRegion(HighlightRegionType.LABEL, 'myLabel;'); 820 assertHasRegion(HighlightRegionType.LABEL, 'myLabel;');
821 }); 821 });
822 } 822 }
823 823
824 test_LIBRARY_NAME_libraryDirective() {
825 addTestFile('''
826 library my.lib.name;
827 ''');
828 return prepareHighlights().then((_) {
829 assertHasStringRegion(HighlightRegionType.LIBRARY_NAME, 'my.lib.name');
830 });
831 }
832
833 test_LIBRARY_NAME_partOfDirective() {
834 _addLibraryForTestPart();
835 addTestFile('''
836 part of my.lib.name;
837 ''');
838 return prepareHighlights().then((_) {
839 assertHasStringRegion(HighlightRegionType.LIBRARY_NAME, 'my.lib.name');
840 });
841 }
842
824 test_LITERAL_BOOLEAN() { 843 test_LITERAL_BOOLEAN() {
825 addTestFile('var V = true;'); 844 addTestFile('var V = true;');
826 return prepareHighlights().then((_) { 845 return prepareHighlights().then((_) {
827 assertHasRegion(HighlightRegionType.LITERAL_BOOLEAN, 'true;'); 846 assertHasRegion(HighlightRegionType.LITERAL_BOOLEAN, 'true;');
828 }); 847 });
829 } 848 }
830 849
831 test_LITERAL_DOUBLE() { 850 test_LITERAL_DOUBLE() {
832 addTestFile('var V = 4.2;'); 851 addTestFile('var V = 4.2;');
833 return prepareHighlights().then((_) { 852 return prepareHighlights().then((_) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 void test_toString() { 1101 void test_toString() {
1083 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); 1102 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS');
1084 } 1103 }
1085 1104
1086 void test_valueOf_unknown() { 1105 void test_valueOf_unknown() {
1087 expect(() { 1106 expect(() {
1088 new HighlightRegionType('no-such-type'); 1107 new HighlightRegionType('no-such-type');
1089 }, throws); 1108 }, throws);
1090 } 1109 }
1091 } 1110 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698