Cargo Test 的测试隔离性;使用 nextest-rs/nextest 来运行 Rust 的单元测试
· ☕ 5 min read
随便写一个测试 mod,包含多个单元测试: mod tests { use std::time::Duration; fn print_my_pid_and_tid() { let pid = std::process::id(); let tid = nix::unistd::gettid(); println!("my pid is {}, tid is {}", pid, tid); } fn hard_job() { std:🧵:sleep(Duration: