OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /// Unit tests for dartdoc. | 5 /// Unit tests for dartdoc. |
6 #library('dartdoc_tests'); | 6 #library('dartdoc_tests'); |
7 | 7 |
8 #import('../../../dartdoc/dartdoc.dart'); | 8 #import('../../../dartdoc/dartdoc.dart'); |
9 #import('../../../dartdoc/markdown.dart', prefix: 'md'); | 9 #import('../../../dartdoc/markdown.dart', prefix: 'md'); |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 library: dummy))). | 185 library: dummy))). |
186 equals('<a class="crossref" href="../../dummy.html#topLevelMethod">' + | 186 equals('<a class="crossref" href="../../dummy.html#topLevelMethod">' + |
187 'topLevelMethod</a>'); | 187 'topLevelMethod</a>'); |
188 }); | 188 }); |
189 | 189 |
190 test('to an unknown name', () { | 190 test('to an unknown name', () { |
191 expect(render(doc.resolveNameReference('unknownName', library: dummy, | 191 expect(render(doc.resolveNameReference('unknownName', library: dummy, |
192 type: klass, member: method))). | 192 type: klass, member: method))). |
193 equals('<code>unknownName</code>'); | 193 equals('<code>unknownName</code>'); |
194 }); | 194 }); |
| 195 |
| 196 test('to a member of another class', () { |
| 197 expect(render(doc.resolveNameReference('Class.method', library: dummy))). |
| 198 equals('<a class="crossref" href="../../dummy/Class.html#method">' + |
| 199 'Class.method</a>'); |
| 200 }); |
| 201 |
| 202 test('to a constructor', () { |
| 203 expect(render(doc.resolveNameReference('new Class', library: dummy))). |
| 204 equals('<a class="crossref" href="../../dummy/Class.html#new:Class">' + |
| 205 'new Class</a>'); |
| 206 }); |
| 207 |
| 208 test('to a named constructor', () { |
| 209 expect(render(doc.resolveNameReference('new Class.namedConstructor', |
| 210 library: dummy))). |
| 211 equals('<a class="crossref" ' + |
| 212 'href="../../dummy/Class.html#new:Class.namedConstructor">new ' + |
| 213 'Class.namedConstructor</a>'); |
| 214 }); |
195 }); | 215 }); |
196 } | 216 } |
OLD | NEW |