@@ -12,7 +12,6 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
12
12
13
13
import 'dartdoc_test_base.dart' ;
14
14
import 'src/test_descriptor_utils.dart' as d;
15
- import 'src/utils.dart' as utils;
16
15
import 'src/utils.dart' ;
17
16
18
17
void main () {
@@ -28,8 +27,7 @@ class OptionsTest extends DartdocTestBase {
28
27
29
28
static const packageName = 'test_package' ;
30
29
31
- Future <void > createPackage (
32
- String name, {
30
+ Future <void > createPackage ({
33
31
String ? dartdocOptions,
34
32
List <d.Descriptor > libFiles = const [],
35
33
List <d.Descriptor > files = const [],
@@ -41,14 +39,13 @@ class OptionsTest extends DartdocTestBase {
41
39
files: files,
42
40
resourceProvider: resourceProvider,
43
41
);
44
- await utils. writeDartdocResources (resourceProvider);
42
+ await writeDartdocResources (resourceProvider);
45
43
packageConfigProvider.addPackageToConfigFor (
46
44
packagePath, packageName, Uri .file ('$packagePath /' ));
47
45
}
48
46
49
47
void test_faviconOption_copiesFaviconFile () async {
50
48
await createPackage (
51
- packageName,
52
49
dartdocOptions: '''
53
50
dartdoc:
54
51
favicon: anicon.png
@@ -59,7 +56,6 @@ dartdoc:
59
56
await (await buildDartdoc (
60
57
additionalArguments: [
61
58
'--auto-include-dependencies' ,
62
- '--no-link-to-remote' ,
63
59
],
64
60
))
65
61
.generateDocs ();
@@ -73,7 +69,6 @@ dartdoc:
73
69
74
70
void test_headerOption_addsContentToIndexFile () async {
75
71
await createPackage (
76
- packageName,
77
72
dartdocOptions: '''
78
73
dartdoc:
79
74
header: ['extras/header.html']
@@ -93,7 +88,6 @@ dartdoc:
93
88
94
89
void test_footerOption_addsContentToIndexFile () async {
95
90
await createPackage (
96
- packageName,
97
91
dartdocOptions: '''
98
92
dartdoc:
99
93
footer: ['extras/footer.html']
@@ -113,7 +107,6 @@ dartdoc:
113
107
114
108
void test_footerTextOption_addsTextToIndexFile () async {
115
109
await createPackage (
116
- packageName,
117
110
dartdocOptions: '''
118
111
dartdoc:
119
112
footerText: ['extras/footer.txt']
@@ -133,7 +126,6 @@ dartdoc:
133
126
134
127
void test_excludeFooterVersionOption_doesNotDisplayVersion () async {
135
128
await createPackage (
136
- packageName,
137
129
dartdocOptions: '''
138
130
dartdoc:
139
131
excludeFooterVersion: true
@@ -161,7 +153,6 @@ dartdoc:
161
153
162
154
void test_examplePathPrefixOption_findsExamplesInACustomPath () async {
163
155
await createPackage (
164
- packageName,
165
156
dartdocOptions: '''
166
157
dartdoc:
167
158
examplePathPrefix: 'package_examples'
@@ -199,7 +190,6 @@ An example in an unusual dir.
199
190
200
191
void test_includeOption_canBeSpecifiedInOptionsFile () async {
201
192
await createPackage (
202
- packageName,
203
193
dartdocOptions: '''
204
194
dartdoc:
205
195
include: ["library_1", "library_2"]
@@ -230,7 +220,6 @@ class Baz {}
230
220
231
221
void test_includeCommandLineOption_overridesOptionsFileOption () async {
232
222
await createPackage (
233
- packageName,
234
223
dartdocOptions: '''
235
224
dartdoc:
236
225
include: ["library_1", "library_2"]
@@ -262,7 +251,6 @@ class Baz {}
262
251
263
252
void test_excludeCommandLineOption_overridesOptionsFileOption () async {
264
253
await createPackage (
265
- packageName,
266
254
dartdocOptions: '''
267
255
dartdoc:
268
256
include: ["library_1", "library_2"]
@@ -291,7 +279,6 @@ class Bar {}
291
279
void
292
280
test_showUndocumentedCategoriesOption_showsUndocumentedCategories () async {
293
281
await createPackage (
294
- packageName,
295
282
dartdocOptions: '''
296
283
dartdoc:
297
284
showUndocumentedCategories: true
@@ -317,7 +304,6 @@ class Foo {}
317
304
318
305
void test_categoryOrderOption_ordersCategories () async {
319
306
await createPackage (
320
- packageName,
321
307
dartdocOptions: '''
322
308
dartdoc:
323
309
categories:
@@ -362,7 +348,6 @@ class C3 {}
362
348
363
349
void test_categoriesNotIncludedInCategoryOrder_areOrderedAtTheEnd () async {
364
350
await createPackage (
365
- packageName,
366
351
dartdocOptions: '''
367
352
dartdoc:
368
353
categories:
@@ -413,7 +398,6 @@ class C4 {}
413
398
414
399
void test_categoriesAreOnlyTrackedWhenUsed () async {
415
400
await createPackage (
416
- packageName,
417
401
dartdocOptions: '''
418
402
dartdoc:
419
403
categories:
@@ -449,7 +433,6 @@ class C1 {}
449
433
void
450
434
test_templatesDirOption_referencingANonExistentDirectory_resultsInDartdocFailure () async {
451
435
await createPackage (
452
- packageName,
453
436
libFiles: [
454
437
d.file ('library_1.dart' , '''
455
438
library library_1;
@@ -469,7 +452,6 @@ class Foo {}
469
452
470
453
void test_templatesDirOption_specifiesTheTemplatesToUse () async {
471
454
await createPackage (
472
- packageName,
473
455
libFiles: [
474
456
d.file ('library_1.dart' , '''
475
457
library library_1;
@@ -512,7 +494,6 @@ class Foo {}
512
494
void
513
495
test_templatesDirOptionReferencingAnEmptyDirectory_resultsInDartdocFailure () async {
514
496
await createPackage (
515
- packageName,
516
497
libFiles: [
517
498
d.file ('library_1.dart' , '''
518
499
library library_1;
@@ -533,7 +514,6 @@ class Foo {}
533
514
534
515
void test_quietOption_resultsInNoProgressOrOtherLogging () async {
535
516
await createPackage (
536
- packageName,
537
517
libFiles: [
538
518
d.file ('library_1.dart' , '''
539
519
library library_1;
@@ -558,7 +538,6 @@ Found 1 warning and 0 errors.
558
538
559
539
void test_noGenerateDocsOption_resultsInNoLoggingAndNoGeneratedDocs () async {
560
540
await createPackage (
561
- packageName,
562
541
libFiles: [
563
542
d.file ('library_1.dart' , '''
564
543
library library_1;
@@ -588,15 +567,14 @@ Found 1 warning and 0 errors.
588
567
589
568
void test_jsonOption_resultsInJsonOutput () async {
590
569
await createPackage (
591
- packageName,
592
570
libFiles: [
593
571
d.file ('library_1.dart' , '''
594
572
library library_1;
595
573
class Foo {}
596
574
''' ),
597
575
],
598
576
);
599
- await utils. writeDartdocResources (resourceProvider);
577
+ await writeDartdocResources (resourceProvider);
600
578
final dartdoc = await buildDartdoc (useJson: true );
601
579
await dartdoc.generateDocs ();
602
580
@@ -609,7 +587,7 @@ class Foo {}
609
587
610
588
void test_nonExistentOption_resultsInFatalError () async {
611
589
expect (
612
- () => utils. generatorContextFromArgv ([
590
+ () => generatorContextFromArgv ([
613
591
'--nonexistent' ,
614
592
], packageMetaProvider),
615
593
throwsA (isA <ArgParserException >().having (
@@ -622,7 +600,7 @@ class Foo {}
622
600
623
601
void test_nonExistentInputPath_resultsInFatalError () async {
624
602
expect (
625
- () => utils. generatorContextFromArgv ([
603
+ () => generatorContextFromArgv ([
626
604
'--input' ,
627
605
'non-existent' ,
628
606
], packageMetaProvider),
@@ -638,7 +616,6 @@ class Foo {}
638
616
639
617
void test_limitFilesCreated_maxFileCountIsReached () async {
640
618
await createPackage (
641
- packageName,
642
619
libFiles: [
643
620
d.file ('library_1.dart' , '''
644
621
library library_1;
@@ -659,7 +636,6 @@ class Foo {
659
636
660
637
void test_limitFilesCreated_maxFileCountIsNotReached () async {
661
638
await createPackage (
662
- packageName,
663
639
libFiles: [
664
640
d.file ('library_1.dart' , '''
665
641
library library_1;
@@ -677,7 +653,6 @@ class Foo {
677
653
678
654
void test_limitFilesCreated_maxTotalSizeIsReached () async {
679
655
await createPackage (
680
- packageName,
681
656
libFiles: [
682
657
d.file ('library_1.dart' , '''
683
658
library library_1;
@@ -698,7 +673,6 @@ class Foo {
698
673
699
674
void test_limitFilesCreated_maxTotalSizeIsNotReached () async {
700
675
await createPackage (
701
- packageName,
702
676
libFiles: [
703
677
d.file ('library_1.dart' , '''
704
678
library library_1;
0 commit comments