-
Notifications
You must be signed in to change notification settings - Fork 39
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 possibility to replace assert_eq!
with custom assertion
#31
Comments
The question is - should this setting be active for one |
How about
to
|
Is there any progress on this issue? I would be very glad to be able to set the assertion macro globally or locally and have the clean => syntax. |
Unfortunately not. Life called and neither me nor @frondeus have a lot of free time, so test-case lives in suspended state. With this issue, idea is from some time back and wasn't ever fully fleshed out (we found no real world use case to base it on). If it is something you'd like and have some time to spare, introducing it yourself is an option (I can guarantee as much that I'm reviewing PR's actively). As for design - I wouldn't oppose global |
An idea for #73 that came to my mind:
We could provide an option to manually map assertions in some cases.
which in turn allows:
Still no idea how to apprach global replacement though, but this goes with the spirit of test case in my opinion. |
Use //third_party/rust_crates:pretty_assertions crate pretty-prints assert_eq! failures, to make the difference easier to spot. We are not able to just use `assert_eq!` in `test_case` tests because it generating test with `use super::*` It is a known issue frondeus/test-case#31 Test: fx test input_pipeline_lib_tests Bug: 89598 Change-Id: I73fd51765c2c5ba8d6c0f491568aaa8eb84b84a7 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/633294 Reviewed-by: Mukesh Agrawal <[email protected]> Reviewed-by: Filip Filmar <[email protected]> Commit-Queue: Jianpeng Chao <[email protected]>
I've relaxed a bit requirements on
I believe this covers all initial work needed to allow custom assertions. |
When using
=> expected
syntax it could be nice to set up what assertion shall we use.It might be extra attribute:
this could be expanded into:
The text was updated successfully, but these errors were encountered: