Skip to content

Commit f8f8bad

Browse files
committed
Reduce the expected number of categorized libraries in Dart SDK
1 parent 591173b commit f8f8bad

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tool/task.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,8 @@ Not all files are formatted:
937937
Future<void> validateSdkDocs() async {
938938
await docSdk();
939939
const expectedLibCount = 0;
940-
const expectedSubLibCounts = {19, 20, 21};
941-
const expectedTotalCounts = {19, 20, 21};
940+
const expectedSubLibCount = 13;
941+
const expectedTotalCount = 20;
942942
var indexHtml = File(path.join(_sdkDocsDir.path, 'index.html'));
943943
if (!indexHtml.existsSync()) {
944944
throw StateError("No 'index.html' found for the SDK docs");
@@ -955,8 +955,8 @@ Future<void> validateSdkDocs() async {
955955

956956
var foundSubLibCount =
957957
_findCount(indexContents, '<li class="section-subitem"><a href="dart-');
958-
if (!expectedSubLibCounts.contains(foundSubLibCount)) {
959-
throw StateError("Expected $expectedSubLibCounts 'dart:' entries in "
958+
if (expectedSubLibCount != foundSubLibCount) {
959+
throw StateError("Expected $expectedSubLibCount 'dart:' entries in "
960960
"'index.html' to be in categories, but found $foundSubLibCount");
961961
}
962962
print('$foundSubLibCount index.html dart: entries in categories found');
@@ -965,11 +965,11 @@ Future<void> validateSdkDocs() async {
965965
var libraries =
966966
_sdkDocsDir.listSync().where((fs) => fs.path.contains('dart-'));
967967
var libraryCount = libraries.length;
968-
if (!expectedTotalCounts.contains(libraryCount)) {
968+
if (expectedTotalCount != libraryCount) {
969969
var libraryNames =
970970
libraries.map((l) => "'${path.basename(l.path)}'").join(', ');
971971
throw StateError('Unexpected docs generated for SDK libraries; expected '
972-
'$expectedTotalCounts directories, but $libraryCount directories were '
972+
'$expectedTotalCount directories, but $libraryCount directories were '
973973
'generated: $libraryNames');
974974
}
975975
print("Found $libraryCount 'dart:' libraries");

0 commit comments

Comments
 (0)