Skip to content

Commit db6f15a

Browse files
authored
Update for latest sdk analyzer and work around dart:ffi (#1937)
* Update for latest sdk analyzer and work around dart:ffi * should be s star not s plus * Review comments
1 parent 34dd370 commit db6f15a

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void main() {
114114
expect(untypedMap.constantValue, equals('const {}'));
115115
expect(typedSet.modelType.name, equals('Set'));
116116
expect(typedSet.modelType.typeArguments.map((a) => a.name).toList(), equals(['String']));
117-
expect(typedSet.constantValue, equals('const &lt;String&gt; {}'));
117+
expect(typedSet.constantValue, matches(new RegExp(r'const &lt;String&gt;\s?{}')));
118118
});
119119
});
120120

@@ -3042,8 +3042,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
30423042
});
30433043

30443044
test('PRETTY_COLORS', () {
3045-
expect(prettyColorsConstant.constantValue,
3046-
"const &lt;String&gt; [COLOR_GREEN, COLOR_ORANGE, &#39;blue&#39;]");
3045+
expect(prettyColorsConstant.constantValue, matches(new RegExp(
3046+
r"const &lt;String&gt;\s?\[COLOR_GREEN, COLOR_ORANGE, &#39;blue&#39;\]")));
30473047
});
30483048

30493049
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)