Skip to content

Update for latest sdk analyzer and work around dart:ffi #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 &lt;String&gt; {}'));
expect(typedSet.constantValue, matches(new RegExp(r'const &lt;String&gt;\s?{}')));
});
});

Expand Down Expand Up @@ -3042,8 +3042,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
});

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

test('MY_CAT is linked', () {
Expand Down
15 changes: 8 additions & 7 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -959,24 +959,25 @@ Future<void> testDartdocFlutterPlugin() async {
@Task('Validate the SDK doc build.')
@Depends(buildSdkDocs)
void validateSdkDocs() {
const expectedLibCount = 0;
const expectedSubLibCount = 19;
const expectedLibCounts = [0, 1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a comment explaining why we're tolerant of both 19 and 20 core libs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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');
}
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');
}
Expand All @@ -985,9 +986,9 @@ void validateSdkDocs() {
// 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');

Expand Down