Labels: bug, checks-crate
Crate: checks
Description
Several checks' unit tests assert only findings.len() and never the finding's function_name or line, so a regression in which method is flagged (or where the finding is anchored — see the method.span() vs fn_token.span() issue) passes silently:
crates/checks/src/missing_nonce.rs — flags_missing_nonce / ignores_with_nonce
crates/checks/src/missing_event_for_admin_change.rs — flags_missing_event
crates/checks/src/unprotected_token_mint.rs — flags_unprotected_mint
crates/checks/src/unprotected_contract_deployment.rs — flags_unprotected_deployer
crates/checks/src/large_loop.rs — flags_loop / flags_while
By contrast auth.rs, admin.rs, transfer.rs assert hits[0].function_name / severity.
Acceptance Criteria
Difficulty: beginner
Labels: bug, checks-crate
Crate: checks
Description
Several checks' unit tests assert only
findings.len()and never the finding'sfunction_nameorline, so a regression in which method is flagged (or where the finding is anchored — see themethod.span()vsfn_token.span()issue) passes silently:crates/checks/src/missing_nonce.rs—flags_missing_nonce/ignores_with_noncecrates/checks/src/missing_event_for_admin_change.rs—flags_missing_eventcrates/checks/src/unprotected_token_mint.rs—flags_unprotected_mintcrates/checks/src/unprotected_contract_deployment.rs—flags_unprotected_deployercrates/checks/src/large_loop.rs—flags_loop/flags_whileBy contrast
auth.rs,admin.rs,transfer.rsasserthits[0].function_name/ severity.Acceptance Criteria
assert_eq!(hits[0].function_name, "<expected>")(and alineassertion where the fixture makes it meaningful) to the listed tests.Difficulty: beginner