Skip to content

Commit 78c0b17

Browse files
authored
Fix validation of SDK docs post-categories (#1650)
1 parent c758441 commit 78c0b17

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,4 @@ packages:
408408
source: hosted
409409
version: "2.1.13"
410410
sdks:
411-
dart: ">=2.0.0-dev.23.0 <=2.0.0-dev.42.0"
411+
dart: ">=2.0.0-dev.23.0 <=2.0.0-dev.43.0"

tool/grind.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ updateTestPackageDocs() async {
627627
@Task('Validate the SDK doc build.')
628628
@Depends(buildSdkDocs)
629629
validateSdkDocs() {
630-
const expectedLibCount = 19;
631-
630+
const expectedLibCount = 7;
631+
const expectedSubLibCount = 12;
632632
File indexHtml = joinFile(sdkDocsDir, ['index.html']);
633633
if (!indexHtml.existsSync()) {
634634
fail('no index.html found for SDK docs');
@@ -642,12 +642,20 @@ validateSdkDocs() {
642642
}
643643
log('$foundLibs index.html dart: entries found');
644644

645+
int foundSubLibs =
646+
_findCount(indexContents, '<li class="section-subitem"><a href="dart-');
647+
if (foundSubLibs != expectedSubLibCount) {
648+
fail(
649+
'expected $expectedSubLibCount dart: index.html entries in categories, found $foundSubLibs');
650+
}
651+
log('$foundSubLibs index.html dart: entries in categories found');
652+
645653
// check for the existence of certain files/dirs
646654
var libsLength =
647655
sdkDocsDir.listSync().where((fs) => fs.path.contains('dart-')).length;
648-
if (libsLength != expectedLibCount) {
656+
if (libsLength != expectedLibCount + expectedSubLibCount) {
649657
fail('docs not generated for all the SDK libraries, '
650-
'expected $expectedLibCount directories, generated $libsLength directories');
658+
'expected ${expectedLibCount + expectedSubLibCount} directories, generated $libsLength directories');
651659
}
652660
log('$libsLength dart: libraries found');
653661

0 commit comments

Comments
 (0)