Skip to content

Add any_map support #158

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 4 commits into from
May 16, 2018
Merged

Add any_map support #158

merged 4 commits into from
May 16, 2018

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented May 16, 2018

No description provided.

@kevmoo kevmoo requested review from jakemac53 and natebosch May 16, 2018 18:17
test('empty', () async {
var builder = jsonSerializable(BuilderOptions.empty) as PartBuilder;
expect(builder, isNotNull);
expect(records, isEmpty);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that since the logs come through asynchronously you would never see them at this point, you would need to add an await null or something along those lines. Not really sure the absolute best way to deal with it honestly.

config[entry.key] = entry.value;

expect(() => jsonSerializable(new BuilderOptions(config)),
_throwsCastError);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Worth checking the actual message here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so. They will all be 'String is not a bool' etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ya I was just wondering if you wanted to check the cast messages were correct, but its probably overkill

as PartBuilder;
expect(builder, isNotNull);

expect(records.single.message,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't get how this is passing given my comment above...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as discussed...

@@ -38,21 +38,22 @@ KitchenSink _$KitchenSinkFromJson(Map<String, dynamic> json) => new KitchenSink(
..stringDateTimeMap = json['stringDateTimeMap'] == null
? null
: new Map<String, DateTime>.fromIterables(
(json['stringDateTimeMap'] as Map<String, dynamic>).keys,
(json['stringDateTimeMap'] as Map).keys.cast<String>(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: should we be using .map instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same-same, right? This seems easier...

@kevmoo kevmoo merged commit 2c60bb3 into master May 16, 2018
@kevmoo kevmoo deleted the any_map branch May 16, 2018 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants