DSCC
主页 / cookbook / 02-test-generation / report_dscc

02 · Test Generation — run artifact

2026-04-16 真机捕获。完整日志见 dscc_run.log,生成的测试文件原样镜像在 generated_utils_test.rs

模型 doubao-seed-2.0-code(Volces ARK)
权限模式 danger-full-access —— 比 README 推荐的 workspace-write 放宽,因为模型要跑 cargo test,而 workspace-write 会对 bash 请求弹审批。生产 CI 里应保留 workspace-write,并用 PreToolUse 钩子自动放行 cargo *
实际调用的工具 read_file(src/lib.rs、src/utils.rs)、glob_searchtests/**/*.rs)、write_filetests/utils_test.rs)、bashcargo test
src/utils.rs sha256 7e9e2f8bc83b60e916383f485fd369c86f12c1c3 —— 前后一致
新增文件 tests/utils_test.rs(2627 B,19 条用例,1 个 #[test],共享表格)

验证

$ cargo test
... Running tests/utils_test.rs ... ok (1 passed)

三段覆盖

分段 生成表格中的 case
正常 "10s""2m""1h"
边界—零 "0s""0m""0h"
边界—空白 " 5s ""\t3m\n"
边界—极大 "18446744073709551615s"u64::MAX
错误—空串 """ "
错误—未知单位 "5d""10ms"
错误—负数 "-5s""-10m"
错误—非数字前缀 "abc123s"
错误—仅单位 "s""m""h"

对照验收标准