Skip to content

Commit a7a01a9

Browse files
committed
Fix some tests
1 parent b7bb5d2 commit a7a01a9

File tree

9 files changed

+26
-10
lines changed

9 files changed

+26
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.22.0
2+
* Added the ability to run external tools on a section of documentation and
3+
replace it with the output of the tool.
4+
15
## 0.21.0
26
* Expand categories to all top level items as well as libraries. (#1681, #1353)
37
* The categoryOrder option in dartdoc_options.yaml and the command line

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dartdoc
22
# Also update the `version` field in lib/dartdoc.dart.
3-
version: 0.21.0
3+
version: 0.22.0
44
author: Dart Team <[email protected]>
55
description: A documentation generator for Dart.
66
homepage: https://github.com/dart-lang/dartdoc

test/model_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void main() {
336336
});
337337

338338
test('multiple packages, sorted default', () {
339-
expect(ginormousPackageGraph.localPackages, hasLength(4));
339+
expect(ginormousPackageGraph.localPackages, hasLength(5));
340340
expect(ginormousPackageGraph.localPackages.first.name,
341341
equals('test_package'));
342342
});
@@ -1267,7 +1267,7 @@ void main() {
12671267
});
12681268

12691269
test('correctly finds all the classes', () {
1270-
expect(classes, hasLength(28));
1270+
expect(classes, hasLength(29));
12711271
});
12721272

12731273
test('abstract', () {

test/tool_runner_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main() {
4545
expect(
4646
result,
4747
contains(new RegExp(
48-
r'Args: \[--file=.*[/\\]dartdoc_tools_[^/\\]+[/\\]input_\d+\]')));
48+
r'Args: \[--file=<INPUT_FILE>]')));
4949
expect(result, contains('## `TEST INPUT`'));
5050
});
5151
test('can invoke a non-Dart tool', () {

testing/test_package/bin/drill.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ void main(List<String> argList) {
1313
argParser.addOption('special');
1414
final ArgResults args = argParser.parse(argList);
1515

16-
print('Args: ${argList}');
16+
// Normalize the filename, since it includes random
17+
// and system-specific components, but make sure it
18+
// matches the pattern we expect.
19+
RegExp filenameRegExp = new RegExp(
20+
r'(--file=)(.*)([/\\]dartdoc_tools_)([^/\\]+)([/\\]input_)(\d+)');
21+
List<String> normalized = argList.map((String arg) {
22+
if (filenameRegExp.hasMatch(arg)) {
23+
return '--file=<INPUT_FILE>';
24+
} else {
25+
return arg;
26+
}
27+
}).toList();
28+
print('Args: $normalized');
1729
if (args['file'] != null) {
1830
File file = new File(args['file']);
1931
if (file.existsSync()) {
@@ -26,4 +38,4 @@ void main(List<String> argList) {
2638
}
2739
}
2840
exit(0);
29-
}
41+
}

testing/test_package_docs_dev/__404error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="generator" content="made with love by dartdoc 0.21.0">
7+
<meta name="generator" content="made with love by dartdoc 0.22.0">
88
<meta name="description" content="test_package API docs, for the Dart programming language.">
99
<title>test_package - Dart API docs</title>
1010

testing/test_package_docs_dev/ex/ToolUser/invokeTool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h1>invokeTool method</h1>
7272
</section>
7373
<section class="desc markdown">
7474
<p>Invokes a tool.</p>
75-
<p>Args: <code>--file=/var/folders/8m/5my4p3zj5nq4ssxv_lqpz828000r4t/T/dartdoc_tools_hKW4dC/input_1, --special= |[</code>!@#"'$%^&amp;*()_+]</p>
75+
<p>Args: <code>--file=&lt;INPUT_FILE&gt;, --special= |[</code>!@#"'$%^&amp;*()_+]</p>
7676
<h2 id="yes-it-is"><code>Yes it is!</code></h2>
7777
<h2 id="ok-fine-it-isnt"><code>Ok, fine it isn't.</code></h2>
7878
</section>

testing/test_package_docs_dev/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="generator" content="made with love by dartdoc 0.21.0">
7+
<meta name="generator" content="made with love by dartdoc 0.22.0">
88
<meta name="description" content="test_package API docs, for the Dart programming language.">
99
<title>test_package - Dart API docs</title>
1010

0 commit comments

Comments
 (0)