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

Unified Diff: pkg/analysis_server/test/analysis_notification_highlights_test.dart

Issue 363363002: Add failing test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 012bb7d801e00b2f6ab83c95c49204a69daeef83..f0b81c279c2d1978b93709dbfdfa2ddeddeb5923 100644
--- a/pkg/analysis_server/test/analysis_notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_highlights_test.dart
@@ -34,8 +34,24 @@ class _AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
return;
}
}
- fail('Expected to find (offset=$offset; length=$length; type=$type) in\n'
- '${regions.join('\n')}');
+ StringBuffer buffer = new StringBuffer();
+ buffer.write('Expected to find (type=');
+ buffer.write(type.name);
+ buffer.write('; offset=');
+ buffer.write(offset);
+ buffer.write('; length=');
+ buffer.write(length);
+ buffer.write(') in\n');
+ for (_HighlightRegion region in regions) {
+ buffer.write(' (type=');
+ buffer.write(region.type);
+ buffer.write('; offset=');
+ buffer.write(region.offset);
+ buffer.write('; length=');
+ buffer.write(region.length);
+ buffer.write(') in\n');
+ }
+ fail(buffer.toString());
}
void assertHasRegion(HighlightType type, String search, [int length = -1]) {
@@ -438,6 +454,28 @@ void f() {}
});
}
+ test_COMMENT() {
+ addTestFile('''
+/**
+ * documentation comment
+ */
+void main() {
+ // end-of-line comment
+ my_function(1);
+}
+
+void my_function(String a) {
+ /* block comment */
+}
+''');
+ return prepareHighlights(() {
+ // TODO(brianwilkerson) Make this test pass.
+// assertHasRegion(HighlightType.COMMENT_END_OF_LINE, '//', 22);
+// assertHasRegion(HighlightType.COMMENT_BLOCK, '/* b', 19);
+// assertHasRegion(HighlightType.COMMENT_DOCUMENTATION, '/**', 32);
+ });
+ }
+
test_CONSTRUCTOR() {
addTestFile('''
class AAA {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698