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
diff --git a/pubspec.yaml b/pubspec.yaml
index 08ab3b5..acb8f14 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -8,7 +8,7 @@
sdk: '>=2.1.0-dev.9.4 <3.0.0'
dependencies:
- analyzer: ^0.35.0
+ analyzer: ^0.35.1
args: '>=1.4.1 <2.0.0'
collection: ^1.2.0
crypto: ^2.0.6
diff --git a/test/model_test.dart b/test/model_test.dart
index f35c08a..6e2e8f5 100644
--- a/test/model_test.dart
+++ b/test/model_test.dart
@@ -114,7 +114,7 @@
expect(untypedMap.constantValue, equals('const {}'));
expect(typedSet.modelType.name, equals('Set'));
expect(typedSet.modelType.typeArguments.map((a) => a.name).toList(), equals(['String']));
- expect(typedSet.constantValue, equals('const <String> {}'));
+ expect(typedSet.constantValue, matches(new RegExp(r'const <String>\s?{}')));
});
});
@@ -3042,8 +3042,8 @@
});
test('PRETTY_COLORS', () {
- expect(prettyColorsConstant.constantValue,
- "const <String> [COLOR_GREEN, COLOR_ORANGE, 'blue']");
+ expect(prettyColorsConstant.constantValue, matches(new RegExp(
+ r"const <String>\s?\[COLOR_GREEN, COLOR_ORANGE, 'blue'\]")));
});
test('MY_CAT is linked', () {
diff --git a/tool/grind.dart b/tool/grind.dart
index 64ef21b..75ab337 100644
--- a/tool/grind.dart
+++ b/tool/grind.dart
@@ -959,8 +959,11 @@
@Task('Validate the SDK doc build.')
@Depends(buildSdkDocs)
void validateSdkDocs() {
- const expectedLibCount = 0;
- const expectedSubLibCount = 19;
+ // TODO(jcollins-g): Remove flexibility in library counts once dev build
+ // includes https://dart-review.googlesource.com/c/sdk/+/93160
+ const expectedLibCounts = [0, 1];
+ const expectedSubLibCount = [19, 20];
+ const expectedTotalCount = [19, 20];
File indexHtml = joinFile(sdkDocsDir, ['index.html']);
if (!indexHtml.existsSync()) {
fail('no index.html found for SDK docs');
@@ -968,15 +971,15 @@
log('found index.html');
String indexContents = indexHtml.readAsStringSync();
int foundLibs = _findCount(indexContents, ' <li><a href="dart-');
- if (foundLibs != expectedLibCount) {
+ if (!expectedLibCounts.contains(foundLibs)) {
fail(
- 'expected $expectedLibCount dart: index.html entries, found $foundLibs');
+ 'expected $expectedTotalCount dart: index.html entries, found $foundLibs');
}
log('$foundLibs index.html dart: entries found');
int foundSubLibs =
_findCount(indexContents, '<li class="section-subitem"><a href="dart-');
- if (foundSubLibs != expectedSubLibCount) {
+ if (!expectedSubLibCount.contains(foundSubLibs)) {
fail(
'expected $expectedSubLibCount dart: index.html entries in categories, found $foundSubLibs');
}
@@ -985,9 +988,9 @@
// check for the existence of certain files/dirs
var libsLength =
sdkDocsDir.listSync().where((fs) => fs.path.contains('dart-')).length;
- if (libsLength != expectedLibCount + expectedSubLibCount) {
+ if (!expectedTotalCount.contains(libsLength)) {
fail('docs not generated for all the SDK libraries, '
- 'expected ${expectedLibCount + expectedSubLibCount} directories, generated $libsLength directories');
+ 'expected ${expectedTotalCount + expectedTotalCount} directories, generated $libsLength directories');
}
log('$libsLength dart: libraries found');