How to use cargo expand
to expand macros on test files under the tests
folder in a crate?
crate
- src
- lib.rs
- tests
- my_test.rs
Cargo.toml
cargo expand --lib --tests
do not recognize them(?). --bin
doesn't recognize them neither.
In my_test.rs
:
#[test]
fn test_it() {
assert!(true);
}
cargo expand --test test_it
replies with error: no test target named test_it
Do I have to add something to Cargo.toml
so they are included?