Loading...
Loading...
Compare original and translation side by side
Cargo.tomlif let#[expect]#[cfg(test)]tests/#[tokio::test]async-traitasync fnif letLazyLocklazy_static!once_cellCargo.tomlif let#[expect]#[cfg(test)]tests/#[tokio::test]async-traitif letLazyLocklazy_static!once_cell[FILE:LINE] ISSUE_TITLE
Severity: Critical | Major | Minor | Informational
Description of the issue and why it matters.[文件:行号] 问题标题
严重程度: 关键 | 主要 | 次要 | 信息性
问题描述及其影响。| Issue Type | Reference |
|---|---|
Unit tests, assertions, naming, snapshots, rstest, doc tests, | references/unit-tests.md |
Integration tests, async testing, fixtures, test databases, native | references/integration-tests.md |
| Fuzzing, property-based testing, Miri, Loom, benchmarking, compile_fail, custom harness, mocking strategies | references/advanced-testing.md |
| 问题类型 | 参考文档 |
|---|---|
单元测试、断言、命名、快照测试、rstest、文档测试、 | references/unit-tests.md |
集成测试、异步测试、测试夹具、测试数据库、原生trait异步函数Mock、 | references/integration-tests.md |
| 模糊测试、基于属性的测试、Miri、Loom、基准测试、compile_fail、自定义测试 harness、Mock策略 | references/advanced-testing.md |
#[cfg(test)] mod teststests/use super::*test_<function>_<scenario>_<expected>#[cfg(test)] mod teststests/use super::*test_<函数名>_<场景>_<预期结果>#[tokio::test]#[tokio::test(flavor = "multi_thread")]block_on.awaitasync fnasync-trait#[tokio::test]#[tokio::test(flavor = "multi_thread")]block_on.awaitasync fnasync-traitassert_eq!assert_ne!assert!matches!matches!if letassert_eq!assert_ne!assert!matches!matches!if letstd::sync::LazyLocklazy_static!once_cellstd::sync::LazyLocklazy_static!once_cellResult::Err#[should_panic]ResultResult::Err#[should_panic]Result#[expect(lint)]#[allow(lint)]#[expect]#[allow]#[allow]#[expect]#[expect(lint)]#[allow(lint)]#[expect]#[allow]#[allow]#[expect]test_happy_pathmod<function>_should_<behavior>_when_<condition>test_happy_pathmod<函数名>_should_<行为>_when_<条件>cargo instasnapshots/assert_eq!cargo instasnapshots/assert_eq!rstest#[rstest]#[case::name]#[fixture]#[case(1)]#[rstest] #[tokio::test]rstest#[rstest]#[case::名称]#[fixture]#[case(1)]#[rstest] #[tokio::test]/// # Examples#cargo test --doc/// # Examples#cargo test --doc#[should_panic]expectedunwrap()if letasync-traitasync fn#[should_panic]expectedunwrap()if letasync-traitassert!(x == y)assert_eq!(x, y)#[allow]#[expect]lazy_static!once_cellLazyLockassert!(x == y)assert_eq!(x, y)#[expect]#[allow]LazyLocklazy_static!once_cellproptestquickcheckproptestquickcheckunwrap()expect()use super::*#[allow(dead_code)]clone()assert!.is_some().is_empty()unwrap()Result?async-traitdynasync fndyn Traitasync-trait#[expect]LazyLockunwrap()expect()use super::*#[allow(dead_code)]clone()assert!.is_some().is_empty()assert!Resultunwrap()?dynasync-traitdyn Traitasync-trait#[expect]LazyLockbeagle-rust:review-verification-protocolbeagle-rust:review-verification-protocol