Comments (3)
I'm not so sure about it. It seems weird to me to improve the debugging experience for one specific kind of case (which I admit, is common) but not do it for the rest.
There are some other subjective criteria at play for me at least:
- I personally don't want to get in the business of making the proc macro more complex and the added maintenance burden that entails. Mostly because as someone who doesn't work with that part of the ecosystem too much, diving into it to fix things when they go wrong takes a while. But, this is hand wavy and I don't feel strongly, especially if this addition is simple.
- I am in general not particularly swayed by concerns about boiler plate unless it's particularly bad. I suppose I haven't felt your pain. But using
TestResult::error
doesn't seem too bad? Can you show an example of using it? Maybe a simplemacro_rules
macro on your end would cure that problem very easily, for example.
So overall, I'm skeptical of this change. I am not a "hard no" on it though. But that's the way I'm leaning.
from quickcheck.
I personally don't want to get in the business of making the proc macro more complex and the added maintenance burden that entails. Mostly because as someone who doesn't work with that part of the ecosystem too much, diving into it to fix things when they go wrong takes a while. But, this is hand wavy and I don't feel strongly, especially if this addition is simple.
Reluctance to add complexity, especially to proc macros, is totally relatable. In practice, we would differentiate based on an argument (identity
, equivalence
or none), maybe right at the top level of the macro. But it would inflate that macro, especially if more and more cases are added over time.
I am in general not particularly swayed by concerns about boiler plate unless it's particularly bad. I suppose I haven't felt your pain. But using
TestResult::error
doesn't seem too bad?
It's definitely an option. It feels a bit more natural printing two lines of debug messages via two print-like statements but that's just a preference. What actually bothers me, if using eprintln!
, is that I end up printing these values for each stage of shrinking rather than only the final one. Skimming over this implementation of Testable
, using TestResult::error
does already give me what I want in that regard (haven't observed it at runtime, yet EDIT: it does).
Can you show an example of using it?
I do have a few examples in the code I'm currently working on, but it's not open-sourced, yet.
Maybe a simple
macro_rules
macro on your end would cure that problem very easily, for example.
Yes, it would indeed be easy to implement as an independent macro on top of the existing one. But in the end, it's just a minor inconvenience. These test types I described or additional macros wouldn't exactly be a must have. I can live without them.
I will probably play around and maybe post such a macro example here at some point.
from quickcheck.
After reading the documentation some more, I concluded that using the Testable
trait as an extension point is probably the better solution. I already created a PR (#281) demonstrating such a solution.
from quickcheck.
Related Issues (20)
- Cannot use Rng methods on `Gen` when implementing `Arbitrary` HOT 5
- Stack overflow in quickcheck case shrinking HOT 3
- example case sort TEST FAILED HOT 1
- QuickChecking Const Generic Code HOT 5
- Implement Arbitrary for AsMut<[T: Arbitrary]> HOT 2
- Infinite Repetition/Never Ending Test with `f32` and `f64`. HOT 17
- Q: Idiomatic way to specify the length of an arbitrary vector HOT 7
- <newbie> How to generate a number within a range HOT 2
- Negating an integer leads to stack overflow HOT 2
- upgrade notes would be nice. HOT 1
- debug_reprs taking up 41% of test runtime HOT 2
- warning: panic message is not a string literal HOT 1
- Rng Size for Vec Arbitrary cannot be 0
- Impl Clone for Gen
- Implement something like choose_weighted for `Gen`
- Is this still maintained? HOT 1
- Is quickcheck still maintained? HOT 1
- How to combine quickcheck 1+ with fake? HOT 3
- Durations's Arbitrary instance is dependant on Gen's size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quickcheck.