I have many test cases and I would like to filter out few of them out. Is there a way to exclude test cases by specifying a pattern ? Now deleting #[test] is that I might forget to add them back.
Thanks @JManInPhoenix, though in my case I have several test cases. Looks like my example above, which I tried to simplify, ended up confusing my question.
Hmm, perhaps you can use the #[ignore] attribute and the command to run them anyway? Or perhaps you could use a separate module, to group the ones you want to run into a single module, and all the others, into another?
Right now for me, writing/fixing code is a multi-day activity. I thought it would be useful if there is some way to ignore test cases from cargo command like cargo test --exclude-pat "my-patt"
If you want to ignore specific tests one time, you can use cargo test -- --skip test_delta_new_delete. As cuviper says, you can see the cargo test options by using cargo test -- --help.
In general think OptimisticPeach is also right. Use #[ignore] on the tests you don't want to run every time. Those tests will then be ignored. If you want to run the ignored tests you just do cargo test -- --ignored (or include-ignored to run both ignored and the other tests).