如何在"测试"文件夹中展开宏



如何使用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-右

相关内容

最新更新