如何使用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
,以便包括它们?
1条答案
按热度按时间xytpbqjk1#
我能够使用以下命令扩展测试中的宏:
cargo expand --test tests
,可能尝试cargo expand --test my_test
该项目与您的项目类似:
货运版本:1.69.0-nightly