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

Expose a test suite #530

Open
Stargateur opened this issue Feb 9, 2022 · 2 comments
Open

Expose a test suite #530

Stargateur opened this issue Feb 9, 2022 · 2 comments

Comments

@Stargateur
Copy link

It would be nice to have a test suite that test an implementation of Buf and BufMut. It's would avoid everybody to write they own test, also, I expect bytes test would be way more exhaustive.

  • Having a bytes-test crates ?
  • Expose it in bytes ?
  • Other solution ?
@seanmonstar
Copy link
Member

This is a pretty decent idea. It's kind of like the "contracts" you may find in Scala/Haskell, where after you implement a typeclass, you can check to make sure you followed all the expected properties. I suppose a next step would be a formal proposal of all that it would check?

@Stargateur
Copy link
Author

Stargateur commented Feb 10, 2022

I suppose a next step would be a formal proposal of all that it would check?

I'm not sure it's necessary, that may be ask too much. Just a entry api that say "look ok" would be amazing the next level would be "not ok here what doesn't work" like named test.

My motivation is for circbuf that implement a circular buffer that I use for tokio. I just have the idea to have more solid test than https://github.com/jeromefroe/circbuf-rs/blob/master/src/lib.rs#L959

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