@@ -28,18 +28,6 @@ class OptionsTest extends DartdocTestBase {
28
28
29
29
static const packageName = 'test_package' ;
30
30
31
- /*@override
32
- Future<void> setUp() async {
33
- await super.setUp();
34
- startLogging(
35
- isJson: false,
36
- isQuiet: true,
37
- showProgress: true,
38
- outSink: outBuffer,
39
- errSink: errBuffer,
40
- );
41
- }*/
42
-
43
31
Future <void > createPackage (
44
32
String name, {
45
33
String ? dartdocOptions,
@@ -58,65 +46,7 @@ class OptionsTest extends DartdocTestBase {
58
46
packagePath, packageName, Uri .file ('$packagePath /' ));
59
47
}
60
48
61
- /*
62
-
63
- Future<PubPackageBuilder> createPackageBuilder({
64
- List<String> additionalOptions = const [],
65
- bool skipUnreachableSdkLibraries = true,
66
- bool useJson = false,
67
- }) async {
68
- context = await utils.generatorContextFromArgv([
69
- '--input',
70
- packagePath,
71
- '--output',
72
- path.join(packagePath, 'doc'),
73
- '--sdk-dir',
74
- packageMetaProvider.defaultSdkDir.path,
75
- '--allow-tools',
76
- '--no-link-to-remote',
77
- '--no-show-progress',
78
- if (useJson) '--json',
79
- ...additionalOptions,
80
- ], packageMetaProvider);
81
-
82
- var packageConfigProvider = utils
83
- .getTestPackageConfigProvider(packageMetaProvider.defaultSdkDir.path);
84
- packageConfigProvider.addPackageToConfigFor(
85
- packagePath, packageName, Uri.file('$packagePath/'));
86
-
87
- startLogging(
88
- isJson: useJson,
89
- isQuiet: true,
90
- showProgress: true,
91
- outSink: outBuffer,
92
- errSink: errBuffer,
93
- );
94
- return PubPackageBuilder(
95
- context,
96
- packageMetaProvider,
97
- packageConfigProvider,
98
- skipUnreachableSdkLibraries: skipUnreachableSdkLibraries,
99
- );
100
- }
101
-
102
- Future<Dartdoc> buildDartdoc({
103
- List<String> additionalOptions = const [],
104
- bool skipUnreachableSdkLibraries = true,
105
- bool useJson = false,
106
- }) async {
107
- final packageBuilder = await createPackageBuilder(
108
- additionalOptions: additionalOptions,
109
- skipUnreachableSdkLibraries: skipUnreachableSdkLibraries,
110
- useJson: useJson,
111
- );
112
- return await Dartdoc.fromContext(
113
- context,
114
- packageBuilder,
115
- );
116
- }
117
- */
118
-
119
- void test_faviconOptionCopiesFaviconFile () async {
49
+ void test_faviconOption_copiesFaviconFile () async {
120
50
await createPackage (
121
51
packageName,
122
52
dartdocOptions: '''
@@ -141,7 +71,7 @@ dartdoc:
141
71
expect (faviconContent, contains ('Just plain text' ));
142
72
}
143
73
144
- void test_headerOptionAddsContentToIndexFile () async {
74
+ void test_headerOption_addsContentToIndexFile () async {
145
75
await createPackage (
146
76
packageName,
147
77
dartdocOptions: '''
@@ -161,7 +91,7 @@ dartdoc:
161
91
expect (indexContent, contains ('<em>Header</em> things.' ));
162
92
}
163
93
164
- void test_footerOptionAddsContentToIndexFile () async {
94
+ void test_footerOption_addsContentToIndexFile () async {
165
95
await createPackage (
166
96
packageName,
167
97
dartdocOptions: '''
@@ -181,7 +111,7 @@ dartdoc:
181
111
expect (indexContent, contains ('<em>Footer</em> things.' ));
182
112
}
183
113
184
- void test_footerTextOptionAddsTextToIndexFile () async {
114
+ void test_footerTextOption_addsTextToIndexFile () async {
185
115
await createPackage (
186
116
packageName,
187
117
dartdocOptions: '''
@@ -201,7 +131,7 @@ dartdoc:
201
131
expect (indexContent, contains ('Just footer text' ));
202
132
}
203
133
204
- void test_excludeFooterVersionOptionDoesNotDisplayVersion () async {
134
+ void test_excludeFooterVersionOption_doesNotDisplayVersion () async {
205
135
await createPackage (
206
136
packageName,
207
137
dartdocOptions: '''
@@ -229,7 +159,7 @@ dartdoc:
229
159
expect (version.hasMatch (match.group (0 )! ), false , reason: indexContent);
230
160
}
231
161
232
- void test_examplePathPrefixOptionFindsExamplesInACustomPath () async {
162
+ void test_examplePathPrefixOption_findsExamplesInACustomPath () async {
233
163
await createPackage (
234
164
packageName,
235
165
dartdocOptions: '''
@@ -267,7 +197,7 @@ An example in an unusual dir.
267
197
contains ('<code class="language-dart">An example in an unusual dir.' ));
268
198
}
269
199
270
- void test_formatEqualMdOptionGeneratesMarkdownFiles () async {
200
+ void test_formatOption_md_generatesMarkdownFiles () async {
271
201
await createPackage (
272
202
packageName,
273
203
libFiles: [
@@ -286,7 +216,7 @@ class Foo {}
286
216
expect (indexContent, contains ('# Foo class' ));
287
217
}
288
218
289
- void test_formatEqualsBadOptionResultsInDartdocFailure () async {
219
+ void test_formatOption_bad_resultsInDartdocFailure () async {
290
220
await createPackage (
291
221
packageName,
292
222
libFiles: [
@@ -302,7 +232,7 @@ class Foo {}
302
232
'message' , startsWith ('Unsupported output format' ))));
303
233
}
304
234
305
- void test_includeOptionCanBeSpecifiedInOptionsFile () async {
235
+ void test_includeOption_canBeSpecifiedInOptionsFile () async {
306
236
await createPackage (
307
237
packageName,
308
238
dartdocOptions: '''
@@ -333,7 +263,7 @@ class Baz {}
333
263
orderedEquals (['library_1' , 'library_2' ]));
334
264
}
335
265
336
- void test_includeCommandLineOptionOverridesOptionsFileOption () async {
266
+ void test_includeCommandLineOption_overridesOptionsFileOption () async {
337
267
await createPackage (
338
268
packageName,
339
269
dartdocOptions: '''
@@ -365,7 +295,7 @@ class Baz {}
365
295
orderedEquals (['library_3' ]));
366
296
}
367
297
368
- void test_excludeCommandLineOptionOverridesOptionsFileOption () async {
298
+ void test_excludeCommandLineOption_overridesOptionsFileOption () async {
369
299
await createPackage (
370
300
packageName,
371
301
dartdocOptions: '''
@@ -394,7 +324,7 @@ class Bar {}
394
324
}
395
325
396
326
void
397
- test_showUndocumentedCategoriesOptionShowsUndocumentedCategories () async {
327
+ test_showUndocumentedCategoriesOption_showsUndocumentedCategories () async {
398
328
await createPackage (
399
329
packageName,
400
330
dartdocOptions: '''
@@ -420,7 +350,7 @@ class Foo {}
420
350
expect (classFoo.displayedCategories, isNotEmpty);
421
351
}
422
352
423
- void test_categoryOrderOrdersCategories () async {
353
+ void test_categoryOrderOption_ordersCategories () async {
424
354
await createPackage (
425
355
packageName,
426
356
dartdocOptions: '''
@@ -465,7 +395,7 @@ class C3 {}
465
395
equals (['Three' , 'One' , 'Two' ]));
466
396
}
467
397
468
- void test_categoriesNotIncludedInCategoryOrderAreOrderedAtTheEnd () async {
398
+ void test_categoriesNotIncludedInCategoryOrder_areOrderedAtTheEnd () async {
469
399
await createPackage (
470
400
packageName,
471
401
dartdocOptions: '''
@@ -552,7 +482,7 @@ class C1 {}
552
482
}
553
483
554
484
void
555
- test_templatesDirOptionReferencingANonExistentDirectoryResultsInDartdocFailure () async {
485
+ test_templatesDirOption_referencingANonExistentDirectory_resultsInDartdocFailure () async {
556
486
await createPackage (
557
487
packageName,
558
488
libFiles: [
@@ -572,7 +502,7 @@ class Foo {}
572
502
)));
573
503
}
574
504
575
- void test_templatesDirOptionSpecifiesTheTemplatesToUse () async {
505
+ void test_templatesDirOption_specifiesTheTemplatesToUse () async {
576
506
await createPackage (
577
507
packageName,
578
508
libFiles: [
@@ -615,7 +545,7 @@ class Foo {}
615
545
}
616
546
617
547
void
618
- test_templatesDirOptionReferencingAnEmptyDirectoryResultsInDartdocFailure () async {
548
+ test_templatesDirOptionReferencingAnEmptyDirectory_resultsInDartdocFailure () async {
619
549
await createPackage (
620
550
packageName,
621
551
libFiles: [
@@ -691,7 +621,7 @@ Found 1 warning and 0 errors.
691
621
expect (outputDirectory.exists, isFalse);
692
622
}
693
623
694
- void test_jsonOptionResultsInJsonOutput () async {
624
+ void test_jsonOption_resultsInJsonOutput () async {
695
625
await createPackage (
696
626
packageName,
697
627
libFiles: [
@@ -712,7 +642,7 @@ class Foo {}
712
642
expect (errBuffer, isEmpty);
713
643
}
714
644
715
- void test_nonExistentOption_resultsIFatalError () async {
645
+ void test_nonExistentOption_resultsInFatalError () async {
716
646
expect (
717
647
() => utils.generatorContextFromArgv ([
718
648
'--nonexistent' ,
0 commit comments