From 643b8d5739c3939215b0a6bf54d7df0b34061306 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 19 Feb 2019 11:17:06 -0800 Subject: [PATCH 1/3] Update for latest sdk analyzer and work around dart:ffi --- pubspec.yaml | 2 +- test/model_test.dart | 6 +++--- tool/grind.dart | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 08ab3b55ec..acb8f1411a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ environment: 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 f35c08a024..eab9469acf 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -114,7 +114,7 @@ void main() { 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 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, }); 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 64ef21b13b..d56fa5f180 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -959,8 +959,9 @@ Future testDartdocFlutterPlugin() async { @Task('Validate the SDK doc build.') @Depends(buildSdkDocs) void validateSdkDocs() { - const expectedLibCount = 0; - const expectedSubLibCount = 19; + 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 +969,15 @@ void validateSdkDocs() { log('found index.html'); String indexContents = indexHtml.readAsStringSync(); int foundLibs = _findCount(indexContents, '
  • Date: Tue, 19 Feb 2019 13:45:14 -0800 Subject: [PATCH 3/3] Review comments --- tool/grind.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/grind.dart b/tool/grind.dart index d56fa5f180..75ab3374c4 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -959,6 +959,8 @@ Future testDartdocFlutterPlugin() async { @Task('Validate the SDK doc build.') @Depends(buildSdkDocs) void validateSdkDocs() { + // 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];