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

Add asserts for DeserializeSeed #2325

Closed
wants to merge 4 commits into from

Conversation

Shatur
Copy link

@Shatur Shatur commented Nov 23, 2022

Equivalent asserts that accept a seed to test stateful deserialization. Was requested in serde-rs/test#24.

@Shatur Shatur force-pushed the assert-de-tokens-seed branch 2 times, most recently from 44cf4d0 to 1316053 Compare November 23, 2022 00:52
@Shatur Shatur changed the title Add assert_de_seed_tokens Add asserts for DeserializeSeed Nov 23, 2022
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Could you please add a usage example to the documentation of each of the new functions?

I'm not quite sure whether I would want to grow the API of serde_test in this way. The existing interface is already pretty clumsy and limited. But nothing in there is using any private internals of serde, so perhaps it would be best to let others experiment with different designs in a separate crate.

@Shatur
Copy link
Author

Shatur commented Dec 11, 2022

Could you please add a usage example to the documentation of each of the new functions?

@dtolnay Sure, added.

But nothing in there is using any private internals of serde

Deserializer is pub, but it's a private module, I can't use it in a third-party crate.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I gave this another look, and I think I would prefer not to have this in this crate.

Thanks anyway for the PR though!

I would be interested to see someone pursue a library for testing serde impls in a better way as a different crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants