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

Integrate with fake-rs #202

Open
musjj opened this issue Jan 11, 2025 · 2 comments
Open

Integrate with fake-rs #202

musjj opened this issue Jan 11, 2025 · 2 comments

Comments

@musjj
Copy link

musjj commented Jan 11, 2025

fake-rs allows you to generate fakers for newtypes:

#[derive(Debug, Dummy)]
struct NewTypeTuple(#[dummy(faker = "1..100")] usize, String);

But of course, it doesn't work with nutype. So it would be nice if it can integrate with it.

@greyblake
Copy link
Owner

Nutype already partially supports Arbitrary.
I think, it could be possible relatively cheaply implement Fake trait through Arbitrary. On other hand in that case Arbitrary would be mandatory.
I need some time to think about it.

@musjj
Copy link
Author

musjj commented Jan 14, 2025

The nice thing about fake-rs is that it can produce somewhat convincing, human-readable values. For example, people names: https://github.com/cksac/fake-rs/blob/4cfcb90782c5a431a1d247823299144da9db9514/fake/src/locales/mod.rs#L14. This is useful when you want to quickly prototype UI for your API, etc.

It looks like that arbitrary is meant for automated, fuzz testing. So I think the usecases are very different here.

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

No branches or pull requests

2 participants