Open Levitanus opened 2 years ago
I'm working on MIDI functions, and can not make integration test fail by
assert!
macros.If I'm directly using
panic!
it fails, but with literally wrongassert_eq!("one string", "another string");
it continues to show everything is fine.You can see my test function at commit(Levitanus@8830e33).
What am I doing wrong?
Mmh, I don't see the mistake at the moment. Didn't try your code. Are you sure you executed this and not something else? I just tried to put your assert_eq
at the top of the solo_track
step and that made the test fail:
- Solo track β FAILED
Expression
"ahhh!"
"ahhh!"
was expected to be equal to expression
"Not!"
"Not!"
P.S. I'm interested, why Project struct takes
&Track
as reference in methoddelete_track(track)
? Maybe it's better to consume it?
In general, the high-level API is not something that I made with extra care. I want to rewrite it from scratch at some point. In that case, are you talking about the semantics? Like, "deleting" should not make it usable anymore? Could be nice, will think about it for the great rewrite :)
Are you sure you executed this and not something else?
If I panic right after the assert, it fails, so, probably, it walks through the code, but I've done something wrong...
Sorry, I'll return to the project tomorrow evening, we have a concert tomorrow)
P.S. Honestly, I really miss the major part of API) Writing in rust
for a couple of weeks already brought many positive additions to the architecture of my new project. In part, that are not connected with Reaper. But we've built reapy
for more than 3 years, and I miss it so much. There I've known every line of code, and we've made it very expressive and comfortable to use))
So, I'm thinking of freezing everything I'm doing in free time and cover as much as possible. I'll carefully check that PR's tomorrow. And I want to also make the testing process clear for me :)
Thanks!
I've got the problem: before running cargo test
, cargo build --workspace
should be invoked π
Maybe the testing in brief should be considered in docs for... Medium API?
create_test_steps
cargo build --workspace
cargo test
And anything you feel important βΊοΈ
P.S. If You consider issue resolved β feel free to close)
Actually, I liked how you've managed integration test! It would be awesome to have something similar as crate. For the moment by myself I've made only a couple of assert functions, which I use to run through all "steps" and log results.
I'm working on MIDI functions, and can not make integration test fail by
assert!
macros.If I'm directly using
panic!
it fails, but with literally wrongassert_eq!("one string", "another string");
it continues to show everything is fine.You can see my test function at commit(https://github.com/Levitanus/reaper-rs/commit/8830e33c5f8875cc7d786f9febcaa50dc64e579f).
What am I doing wrong?
P.S. I'm interested, why Project struct takes
&Track
as reference in methoddelete_track(track)
? Maybe it's better to consume it?