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

Unified Diff: utils/dartdoc/test/dartdoc_tests.dart

Issue 9146016: Add the ability to link to members and constructors of other classes in Dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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: utils/dartdoc/test/dartdoc_tests.dart
diff --git a/utils/dartdoc/test/dartdoc_tests.dart b/utils/dartdoc/test/dartdoc_tests.dart
index 88e4fc2d3f6ba886a59f9e687ab6019296d4aacb..2ee581886f6f6e4f36d6af6578131bc38d98469d 100644
--- a/utils/dartdoc/test/dartdoc_tests.dart
+++ b/utils/dartdoc/test/dartdoc_tests.dart
@@ -172,5 +172,30 @@ main() {
type: klass, member: method))).
equals('<code>unknownName</code>');
});
+
Bob Nystrom 2012/01/10 00:40:41 Woo tests!
+ test('to an unknown name', () {
+ expect(render(doc.resolveNameReference('unknownName', library: dummy,
+ type: klass, member: method))).
+ equals('<code>unknownName</code>');
+ });
+
+ test('to a member of another class', () {
+ expect(render(doc.resolveNameReference('Class.method', library: dummy))).
+ equals('<a href="../../dummy/Class.html#method" class="crossref">' +
+ 'Class.method</a>');
+ });
+
+ test('to a constructor', () {
+ expect(render(doc.resolveNameReference('new Class', library: dummy))).
+ equals('<a href="../../dummy/Class.html#new:Class" class="crossref">' +
+ 'new Class</a>');
+ });
+
+ test('to a named constructor', () {
+ expect(render(doc.resolveNameReference('new Class.namedConstructor',
+ library: dummy))).
+ equals('<a href="../../dummy/Class.html#new:Class.namedConstructor" ' +
+ 'class="crossref">new Class.namedConstructor</a>');
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698