| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 doc. | 5 /// Unit tests for doc. |
| 6 library dartdocTests; | 6 library dartdocTests; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 }); | 189 }); |
| 190 }); | 190 }); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void _testRunDartDoc(List<String> libraryPaths, void eval(ProcessResult)) { | 193 void _testRunDartDoc(List<String> libraryPaths, void eval(ProcessResult)) { |
| 194 expect(_runDartdoc(libraryPaths).then(eval), completes); | 194 expect(_runDartdoc(libraryPaths).then(eval), completes); |
| 195 } | 195 } |
| 196 | 196 |
| 197 /// The path to the root directory of the dartdoc entrypoint. | 197 /// The path to the root directory of the dartdoc entrypoint. |
| 198 String get _dartdocDir { | 198 String get _dartdocDir { |
| 199 var dir = path.absolute(Platform.script); | 199 var dir = path.absolute(Platform.script.toFilePath()); |
| 200 while (path.basename(dir) != 'dartdoc') { | 200 while (path.basename(dir) != 'dartdoc') { |
| 201 if (!path.absolute(dir).contains('dartdoc') || dir == path.dirname(dir)) { | 201 if (!path.absolute(dir).contains('dartdoc') || dir == path.dirname(dir)) { |
| 202 fail('Unable to find root dartdoc directory.'); | 202 fail('Unable to find root dartdoc directory.'); |
| 203 } | 203 } |
| 204 dir = path.dirname(dir); | 204 dir = path.dirname(dir); |
| 205 } | 205 } |
| 206 return path.absolute(dir); | 206 return path.absolute(dir); |
| 207 } | 207 } |
| 208 | 208 |
| 209 /// The path to use for the package root for subprocesses. | 209 /// The path to use for the package root for subprocesses. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 | 278 |
| 279 validateDartdocMarkdown(String description, String markdown, | 279 validateDartdocMarkdown(String description, String markdown, |
| 280 String html) { | 280 String html) { |
| 281 var dartdoc = new dd.Dartdoc(); | 281 var dartdoc = new dd.Dartdoc(); |
| 282 validate(description, markdown, html, linkResolver: dartdoc.dartdocResolver, | 282 validate(description, markdown, html, linkResolver: dartdoc.dartdocResolver, |
| 283 inlineSyntaxes: dartdoc.dartdocSyntaxes); | 283 inlineSyntaxes: dartdoc.dartdocSyntaxes); |
| 284 } | 284 } |
| OLD | NEW |