Chromium Code Reviews| 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.dart'); | 8 #import('../dartdoc.dart'); |
| 9 #import('../markdown.dart', prefix: 'md'); | 9 #import('../markdown.dart', prefix: 'md'); |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 library: dummy))). | 165 library: dummy))). |
| 166 equals('<a href="../../dummy.html#topLevelMethod" class="crossref">' + | 166 equals('<a href="../../dummy.html#topLevelMethod" class="crossref">' + |
| 167 'topLevelMethod</a>'); | 167 'topLevelMethod</a>'); |
| 168 }); | 168 }); |
| 169 | 169 |
| 170 test('to an unknown name', () { | 170 test('to an unknown name', () { |
| 171 expect(render(doc.resolveNameReference('unknownName', library: dummy, | 171 expect(render(doc.resolveNameReference('unknownName', library: dummy, |
| 172 type: klass, member: method))). | 172 type: klass, member: method))). |
| 173 equals('<code>unknownName</code>'); | 173 equals('<code>unknownName</code>'); |
| 174 }); | 174 }); |
| 175 | |
|
Bob Nystrom
2012/01/10 00:40:41
Woo tests!
| |
| 176 test('to an unknown name', () { | |
| 177 expect(render(doc.resolveNameReference('unknownName', library: dummy, | |
| 178 type: klass, member: method))). | |
| 179 equals('<code>unknownName</code>'); | |
| 180 }); | |
| 181 | |
| 182 test('to a member of another class', () { | |
| 183 expect(render(doc.resolveNameReference('Class.method', library: dummy))). | |
| 184 equals('<a href="../../dummy/Class.html#method" class="crossref">' + | |
| 185 'Class.method</a>'); | |
| 186 }); | |
| 187 | |
| 188 test('to a constructor', () { | |
| 189 expect(render(doc.resolveNameReference('new Class', library: dummy))). | |
| 190 equals('<a href="../../dummy/Class.html#new:Class" class="crossref">' + | |
| 191 'new Class</a>'); | |
| 192 }); | |
| 193 | |
| 194 test('to a named constructor', () { | |
| 195 expect(render(doc.resolveNameReference('new Class.namedConstructor', | |
| 196 library: dummy))). | |
| 197 equals('<a href="../../dummy/Class.html#new:Class.namedConstructor" ' + | |
| 198 'class="crossref">new Class.namedConstructor</a>'); | |
| 199 }); | |
| 175 }); | 200 }); |
| 176 } | 201 } |
| OLD | NEW |