一个模块包含多个测试,如下所示:
#[cfg(test)]
mod tests_cases {
/*
#[test]
fn test_1() {
let a = 1;
let b = 2;
println!("{},{}", a, b);
assert_ne!(a, b);
}
*/
#[test]
fn test_2() {
let c = 1;
let d = 1;
println!("currently working on this: {},{}", c, d);
assert_eq!(c, d);
}
}
Run Code Online (Sandbox Code Playgroud)
当使用输出可见 ( cargo test -- --nocapture) 进行第二个测试时,我不想看到第一个测试的输出。
是否有一个选项可以禁用注释的单元测试?或者是否可以选择只运行第二个单元测试?