Skip to content

Commit f6e19e8

Browse files
committed
Merge branch 'master' into fix-line-number-cache
2 parents 4d85b81 + db6f15a commit f6e19e8

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
sdk: '>=2.1.0-dev.9.4 <3.0.0'
99

1010
dependencies:
11-
analyzer: ^0.35.0
11+
analyzer: ^0.35.1
1212
args: '>=1.4.1 <2.0.0'
1313
collection: ^1.2.0
1414
crypto: ^2.0.6

test/model_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ void main() {
127127
expect(typedSet.modelType.name, equals('Set'));
128128
expect(typedSet.modelType.typeArguments.map((a) => a.name).toList(),
129129
equals(['String']));
130-
expect(typedSet.constantValue, equals('const &lt;String&gt; {}'));
130+
expect(typedSet.constantValue,
131+
matches(new RegExp(r'const &lt;String&gt;\s?{}')));
131132
});
132133
});
133134

@@ -3061,8 +3062,10 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
30613062
});
30623063

30633064
test('PRETTY_COLORS', () {
3064-
expect(prettyColorsConstant.constantValue,
3065-
"const &lt;String&gt; [COLOR_GREEN, COLOR_ORANGE, &#39;blue&#39;]");
3065+
expect(
3066+
prettyColorsConstant.constantValue,
3067+
matches(new RegExp(
3068+
r"const &lt;String&gt;\s?\[COLOR_GREEN, COLOR_ORANGE, &#39;blue&#39;\]")));
30663069
});
30673070

30683071
test('MY_CAT is linked', () {

tool/grind.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -959,24 +959,27 @@ Future<void> testDartdocFlutterPlugin() async {
959959
@Task('Validate the SDK doc build.')
960960
@Depends(buildSdkDocs)
961961
void validateSdkDocs() {
962-
const expectedLibCount = 0;
963-
const expectedSubLibCount = 19;
962+
// TODO(jcollins-g): Remove flexibility in library counts once dev build
963+
// includes https://dart-review.googlesource.com/c/sdk/+/93160
964+
const expectedLibCounts = [0, 1];
965+
const expectedSubLibCount = [19, 20];
966+
const expectedTotalCount = [19, 20];
964967
File indexHtml = joinFile(sdkDocsDir, ['index.html']);
965968
if (!indexHtml.existsSync()) {
966969
fail('no index.html found for SDK docs');
967970
}
968971
log('found index.html');
969972
String indexContents = indexHtml.readAsStringSync();
970973
int foundLibs = _findCount(indexContents, ' <li><a href="dart-');
971-
if (foundLibs != expectedLibCount) {
974+
if (!expectedLibCounts.contains(foundLibs)) {
972975
fail(
973-
'expected $expectedLibCount dart: index.html entries, found $foundLibs');
976+
'expected $expectedTotalCount dart: index.html entries, found $foundLibs');
974977
}
975978
log('$foundLibs index.html dart: entries found');
976979

977980
int foundSubLibs =
978981
_findCount(indexContents, '<li class="section-subitem"><a href="dart-');
979-
if (foundSubLibs != expectedSubLibCount) {
982+
if (!expectedSubLibCount.contains(foundSubLibs)) {
980983
fail(
981984
'expected $expectedSubLibCount dart: index.html entries in categories, found $foundSubLibs');
982985
}
@@ -985,9 +988,9 @@ void validateSdkDocs() {
985988
// check for the existence of certain files/dirs
986989
var libsLength =
987990
sdkDocsDir.listSync().where((fs) => fs.path.contains('dart-')).length;
988-
if (libsLength != expectedLibCount + expectedSubLibCount) {
991+
if (!expectedTotalCount.contains(libsLength)) {
989992
fail('docs not generated for all the SDK libraries, '
990-
'expected ${expectedLibCount + expectedSubLibCount} directories, generated $libsLength directories');
993+
'expected ${expectedTotalCount + expectedTotalCount} directories, generated $libsLength directories');
991994
}
992995
log('$libsLength dart: libraries found');
993996

0 commit comments

Comments
 (0)