Skip to content
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

#123: add tests for different enum representations #166

Merged
merged 4 commits into from
Jun 5, 2019

Conversation

cpud36
Copy link
Contributor

@cpud36 cpud36 commented May 26, 2019

This pull request is addressing issue #123.

Currently it only adds tests mentioned in the issue.
I'm not sure where to put the documentation, so would appreciate some guiding.

If anything needs to be changed, please say it. This is my first PR.

Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

This is great, thank you!
Congrats on your first PR ;)

Now we just need to make Travis happy, let me check why it failed.

@torkleyy
Copy link
Contributor

Multiple tests seem to fail:

https://travis-ci.org/ron-rs/ron/jobs/537411188#L596

@cpud36
Copy link
Contributor Author

cpud36 commented May 26, 2019

(
    type: "VariantA",
    content: (),
)

For such input serde tried to deserialize type field with deserialize_str, and it tried to deserialize value of the type field with deserialize_identifier.
As was expected, both of them failed.

To fix it the following was done:

  • IdDeserializer::deserialize_str was redirected to IdDeserializer::deserialize_identifier
  • In CommaSeparated value is parsed with TagDeserializer wrapper
  • TagDeserializer redirects everything to inner type, except for deserialize_identifier, which it redirects to deserializer_str.

I am not sure, if this have broken something, but tests seem to pass.

@cpud36
Copy link
Contributor Author

cpud36 commented Jun 4, 2019

@torkleyy, is there anything that needs to be done?

Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

Thank you!
bors r+

bors bot added a commit that referenced this pull request Jun 5, 2019
166: #123: add tests for different enum representations r=torkleyy a=cpud36

This pull request is addressing issue #123.

Currently it only adds tests mentioned in the issue.
I'm not sure where to put the documentation, so would appreciate some guiding.

If anything needs to be changed, please say it. This is my first PR.

Co-authored-by: Katasonov Vladyslav <cpud47@gmail.com>
Co-authored-by: cpud36 <vlad.1111@mail.ru>
@bors
Copy link
Contributor

bors bot commented Jun 5, 2019

Build succeeded

@bors bors bot merged commit 64f83ef into ron-rs:master Jun 5, 2019
@CAD97 CAD97 mentioned this pull request May 1, 2020
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