units: Add integration test of API surface#3639
units: Add integration test of API surface#3639apoelstra merged 1 commit intorust-bitcoin:masterfrom
Conversation
30b101e to
88084dc
Compare
|
My dream here is that @apoelstra and I get this one solid then someone else does the same thing for the other crates. @jamillambert would you be wiling to take a stab at this? |
units/tests/api.rs
Outdated
There was a problem hiding this comment.
I split this up from Enums in case there are more tests we would like to do on just structs (eg Constructors are static, inherent methods (C-CTOR))
Yes I can work on this once |
|
Yep, |
|
Tagging @apoelstra incase you don't look at this because its draft, chasing feedback please. |
|
Concept ACK. As for the FIXME, I don't think you can usefully test destructors like this. Obviously if you construct a default instance of an object, destructing it will not fail. The question is whether every API-accessable instance of the object can be infallibly destructed. And for that we pretty-much need to manually read |
In an effort to check off items in the Rust API guidelines checklist (rust-bitcoin#3632) add an integration test file that tests: - The location of re-exports for various typical usage styles. - Regressions in the API surface (things being accidentally moved). - All public types implement Debug (C-DEBUG). - For all non-error types: - `Debug` representation is never empty (C-DEBUG-NONEMPTY) - For all error types: - Derive standard traits as defined by `rust-bitcoin` policy. I used the `cargo check-api` script we have laying around from ages ago (rust-bitcoin#2986) to parse `units` and get a list of the public types.
88084dc to
7b8369f
Compare
|
Removed the |
|
@tcharding should I merge this? Or do you want to iterate any further? |
|
Lets merge. @jamillambert maybe wait a few days before starting on the other crates so you don't have to go back if/when I find more things we can put in this |
In an effort to check off items in the Rust API guidelines checklist (#3632) add an integration test file that tests:
Debugrepresentation is never empty (C-DEBUG-NONEMPTY)rust-bitcoinpolicy.serdetraits (C-SERDE).I used the
cargo check-apiscript we have laying around from ages ago (#2986) to parseunitsand get a list of the public types.