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

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

Issue 679103003: Support for enums semantic highlighting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: small clean up for tests 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
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 773d6f65a8f17648b5c0264402c132a94d9fadbe..7a548177525b0ab6eefcaeac43ef8cf4460d5c3d 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -528,6 +528,33 @@ main(p) {
});
}
+ test_ENUM() {
+ addTestFile('''
+enum MyEnum {A, B, C}
+MyEnum value;
+''');
+ return prepareHighlights().then((_) {
+ assertHasRegion(HighlightRegionType.ENUM, 'MyEnum {');
+ assertHasRegion(HighlightRegionType.ENUM, 'MyEnum value;');
+ });
+ }
+
+ test_ENUM_CONSTANT() {
+ addTestFile('''
+enum MyEnum {AAA, BBB}
+main() {
+ print(MyEnum.AAA);
+ print(MyEnum.BBB);
+}
+''');
+ return prepareHighlights().then((_) {
+ assertHasRegion(HighlightRegionType.ENUM_CONSTANT, 'AAA, ');
+ assertHasRegion(HighlightRegionType.ENUM_CONSTANT, 'BBB}');
+ assertHasRegion(HighlightRegionType.ENUM_CONSTANT, 'AAA);');
+ assertHasRegion(HighlightRegionType.ENUM_CONSTANT, 'BBB);');
+ });
+ }
+
test_FIELD() {
addTestFile('''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698