File tree 4 files changed +18
-6
lines changed
test_package_docs_dev/ex/ToolUser 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ void main() {
336
336
});
337
337
338
338
test ('multiple packages, sorted default' , () {
339
- expect (ginormousPackageGraph.localPackages, hasLength (4 ));
339
+ expect (ginormousPackageGraph.localPackages, hasLength (5 ));
340
340
expect (ginormousPackageGraph.localPackages.first.name,
341
341
equals ('test_package' ));
342
342
});
@@ -1267,7 +1267,7 @@ void main() {
1267
1267
});
1268
1268
1269
1269
test ('correctly finds all the classes' , () {
1270
- expect (classes, hasLength (28 ));
1270
+ expect (classes, hasLength (29 ));
1271
1271
});
1272
1272
1273
1273
test ('abstract' , () {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ void main() {
45
45
expect (
46
46
result,
47
47
contains (new RegExp (
48
- r'Args: \[--file=.*[/\\]dartdoc_tools_[^/\\]+[/\\]input_\d+\ ]' )));
48
+ r'Args: \[--file=<INPUT_FILE> ]' )));
49
49
expect (result, contains ('## `TEST INPUT`' ));
50
50
});
51
51
test ('can invoke a non-Dart tool' , () {
Original file line number Diff line number Diff line change @@ -13,7 +13,19 @@ void main(List<String> argList) {
13
13
argParser.addOption ('special' );
14
14
final ArgResults args = argParser.parse (argList);
15
15
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 ' );
17
29
if (args['file' ] != null ) {
18
30
File file = new File (args['file' ]);
19
31
if (file.existsSync ()) {
@@ -26,4 +38,4 @@ void main(List<String> argList) {
26
38
}
27
39
}
28
40
exit (0 );
29
- }
41
+ }
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ <h1>invokeTool method</h1>
72
72
</ section >
73
73
< section class ="desc markdown ">
74
74
< p > Invokes a tool.</ p >
75
- < p > Args: < code > --file=/var/folders/8m/5my4p3zj5nq4ssxv_lqpz828000r4t/T/dartdoc_tools_hKW4dC/input_1 , --special= |[</ code > !@#"'$%^&*()_+]</ p >
75
+ < p > Args: < code > --file=<INPUT_FILE> , --special= |[</ code > !@#"'$%^&*()_+]</ p >
76
76
< h2 id ="yes-it-is "> < code > Yes it is!</ code > </ h2 >
77
77
< h2 id ="ok-fine-it-isnt "> < code > Ok, fine it isn't.</ code > </ h2 >
78
78
</ section >
You can’t perform that action at this time.
0 commit comments