如何使用cargo expand
在机箱中tests
文件夹下的测试文件上展开宏?
crate
- src
- lib.rs
- tests
- my_test.rs
Cargo.toml
cargo expand --lib --tests
无法识别它们(?(。--bin
也不认识他们。
在my_test.rs
:中
#[test]
fn test_it() {
assert!(true);
}
cargo expand --test test_it
回复error: no test target named test_it
我必须在Cargo.toml
中添加一些内容才能将它们包括在内吗?
我能够使用扩展测试中的宏
cargo expand --test tests
,也许试试cargo expand --test my_test
该项目与您的类似:
crate
- src
- lib.rs
- tests
- tests.rs
Cargo.toml
货运版本:1.69.0-右