Repository navigation
Description
Problem
Rust test discovery currently recognizes only #[test], #[tokio::test], #[async_std::test], and #[rstest]. The parser-backed and lexical-fallback producers each carry their own spelling checks, so they can drift and the prefix-based fallback can also accept lookalike attributes.
That leaves several explicit, source-visible test styles classified as ordinary functions instead of evidence:
- QuickCheck property functions using
#[quickcheck]; - browser/Wasm tests using
#[wasm_bindgen_test]; - parameterized tests using
#[test_case]or#[test_matrix]; - path-qualified forms such as
#[rstest::rstest]and#[quickcheck_macros::quickcheck].
The effect is upstream of related-test scoring: no TestFact is produced, and changed code inside the function can be treated as a production subject.
Required outcome
Add one internal exact test-attribute classifier and use it from both the parser-backed and lexical Rust syntax producers.
Recognize the existing forms plus these explicit test-defining families:
test
tokio::test
async_std::test
rstest / rstest::rstest
quickcheck / quickcheck_macros::quickcheck
wasm_bindgen_test / wasm_bindgen_test::wasm_bindgen_test
test_case / test_case::test_case / ntest::test_case
test_matrix / test_case::test_matrix
Parameterized source functions remain one source-level TestFact; RIPR does not claim to enumerate macro-expanded generated cases.
Acceptance
- Parser-backed indexing emits
TestFactandFunctionFact.is_test = truefor every supported family. - Lexical fallback recognizes the same family, including argument-bearing and whitespace-varied forms.
- Existing
#[test], Tokio, async-std, and rstest behavior remains unchanged. - Prefix lookalikes such as
#[rstest_helper],#[tokio::test_helper],#[test_case_helper], and#[quickcheck_config]remain ordinary attributes. - Unannotated helpers in test files remain helpers rather than executable tests.
- Focused tests exercise both producers and the shared classifier.
Non-goals
- no macro expansion or generated-case enumeration;
- no
proptest!,quickcheck!, custom harness,libtest-mimic, or arbitrary user-defined attribute discovery; - no
cfg_attrevaluation or import-resolution proof for ambiguous custom macros; - no assertion/oracle-strength change, output schema change, support-tier promotion, or runtime test execution.
Proof direction
cargo test -p ripr --lib analysis::syntax -- --nocapture
cargo fmt --all -- --check
cargo clippy -p ripr --lib --tests -- -D warnings
cargo xtask precommit
git diff --checkClaim boundary
Completion lets RIPR treat the named explicit attribute-macro styles as source-level Rust tests in both normal parsing and syntax-error fallback. It does not establish arbitrary framework support or runtime adequacy.
Activity
feat(analysis): recognize explicit test attributes (#3499)
feat(analysis): recognize explicit test attributes (#3499)
feat(analysis): recognize explicit test attributes (#3499)
feat(analysis): recognize explicit test attributes (#3499)
feat(analysis): recognize explicit test attributes (#3499)
EffortlessSteven commentedon Aug 28, 2026
Source-role train integration
This issue is the canonical owner for exact named test-defining attributes across the parser-backed and lexical-fallback producers.
test-casesubset; avoid a parallel classifier.The implementation should therefore expose one exact internal classifier API rather than leave family-specific spelling checks in either producer. If #3519 contains an acceptance detail absent from this body, carry that detail into the shared classifier/tests rather than creating a second production path.
feat(analysis): recognize explicit nonstandard test attributes (#3513)
test(analysis): add source-role conformance corpus and authority check (
docs(specs): ratify RIPR-SPEC-0153 and align capability/public wording (