Skip to content

Commit 60055b4

Browse files
authored
Update validate-sdk-docs task to allow 20 libs (dart-lang#3404)
1 parent d01ddc5 commit 60055b4

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tool/grind.dart

+13-12
Original file line numberDiff line numberDiff line change
@@ -1276,37 +1276,38 @@ Future<void> testDartdocFlutterPlugin() async {
12761276
@Depends(buildSdkDocs)
12771277
void validateSdkDocs() {
12781278
const expectedLibCounts = 0;
1279-
const expectedSubLibCount = {18, 19};
1280-
const expectedTotalCount = {18, 19};
1279+
const expectedSubLibCount = {18, 19, 20};
1280+
const expectedTotalCount = {18, 19, 20};
12811281
var indexHtml = joinFile(_sdkDocsDir, ['index.html']);
12821282
if (!indexHtml.existsSync()) {
1283-
fail('no index.html found for SDK docs');
1283+
fail("No 'index.html' found for the SDK docs");
12841284
}
1285-
log('found index.html');
1285+
log("Found 'index.html'");
12861286
var indexContents = indexHtml.readAsStringSync();
12871287
var foundLibs = _findCount(indexContents, ' <li><a href="dart-');
12881288
if (expectedLibCounts != foundLibs) {
1289-
fail('expected $expectedLibCounts "dart:" index.html entries, found '
1290-
'$foundLibs');
1289+
fail("Expected $expectedLibCounts 'dart:' entries in 'index.html', but "
1290+
'found $foundLibs');
12911291
}
1292-
log('$foundLibs index.html dart: entries found');
1292+
log("Found $foundLibs 'dart:' entries in 'index.html'");
12931293

12941294
var foundSubLibs =
12951295
_findCount(indexContents, '<li class="section-subitem"><a href="dart-');
12961296
if (!expectedSubLibCount.contains(foundSubLibs)) {
1297-
fail('expected $expectedSubLibCount "dart:" index.html entries in '
1298-
'categories, found $foundSubLibs');
1297+
fail("Expected $expectedSubLibCount 'dart:' entries in 'index.html' to be "
1298+
'in categories, but found $foundSubLibs');
12991299
}
13001300
log('$foundSubLibs index.html dart: entries in categories found');
13011301

13021302
// check for the existence of certain files/dirs
13031303
var libsLength =
13041304
_sdkDocsDir.listSync().where((fs) => fs.path.contains('dart-')).length;
13051305
if (!expectedTotalCount.contains(libsLength)) {
1306-
fail('docs not generated for all the SDK libraries, '
1307-
'expected $expectedTotalCount directories, generated $libsLength directories');
1306+
fail('Docs not generated for all the SDK libraries; expected '
1307+
'$expectedTotalCount directories, but $libsLength directories were '
1308+
'generated');
13081309
}
1309-
log('$libsLength dart: libraries found');
1310+
log("Found $libsLength 'dart:' libraries");
13101311

13111312
var futureConstFile =
13121313
joinFile(_sdkDocsDir, [p.join('dart-async', 'Future', 'Future.html')]);

0 commit comments

Comments
 (0)