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

Unified Diff: sdk/lib/_internal/dartdoc/test/comment_map_test.dart

Issue 11358134: Fix for triple-slash dartdocs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/_internal/dartdoc/lib/src/dartdoc/comment_map.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/dartdoc/test/comment_map_test.dart
diff --git a/sdk/lib/_internal/dartdoc/test/comment_map_test.dart b/sdk/lib/_internal/dartdoc/test/comment_map_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ffca31037b672dd5385d958dd35e3443ef2ba88a
--- /dev/null
+++ b/sdk/lib/_internal/dartdoc/test/comment_map_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Unit tests for comment map.
+library commentMapTests;
+
+import 'dart:uri';
+import 'dart:mirrors';
+
+import '../../compiler/implementation/scanner/scannerlib.dart' as dart2js;
+
+// TODO(rnystrom): Better path to unittest.
+import '../../../pkg/unittest/lib/unittest.dart';
Andrei Mouravski 2012/11/08 00:12:07 Add ../../ to the path to get to the right relativ
+
+// TODO(rnystrom): Use "package:" URL (#4968).
+part '../lib/src/dartdoc/comment_map.dart';
+
+class FakeSourceLocation implements SourceLocation {
+ Uri get sourceUri => new Uri('file:///tmp/test.dart');
+ int get offset => 57;
+ String get sourceText => """
+/// Testing
+/// var testing = 'this is source code';
+get foo => 'bar';
+""";
Andrei Mouravski 2012/11/08 00:12:07 I think this """ literal string will still work co
+}
+
+main() {
+ test('triple slashed comments retain newlines', () {
+ Commentmap cm = new CommentMap();
+ var comment = cm.find(new FakeSourceLocation());
+ expect(comment, equals("Testing\n var testing = 'this is source code';"));
Andrei Mouravski 2012/11/08 00:12:07 Split this line at the , so that each line is less
+ });
+}
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/src/dartdoc/comment_map.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698