# 单元测试 ``` cargo test # 查看输出 cargo test -- --nocapture ``` # 覆盖率(cargo-llvm-cov) 安装工具: ``` rustup component add llvm-tools-preview cargo install cargo-llvm-cov --locked ``` 统计行覆盖率并要求 >=90%: ``` ./scripts/coverage.sh # 或 cargo llvm-cov --fail-under-lines 90 ```