Skip to content

test(audit-guard): wire drift_validator_test.rs into crate; drop unused FixedOffset - #378

Open
Paranoa-dev wants to merge 1 commit into
Vero-protocol:mainfrom
Paranoa-dev:fix/349
Open

test(audit-guard): wire drift_validator_test.rs into crate; drop unused FixedOffset#378
Paranoa-dev wants to merge 1 commit into
Vero-protocol:mainfrom
Paranoa-dev:fix/349

Conversation

@Paranoa-dev

Copy link
Copy Markdown
Contributor

Test: wire drift_validator_test.rs into the crate (GrantFox OSS / Third Campaign)

Problem

drift_validator_test.rs existed but was never compiled or run:

  • grep -rn drift_validator_test . matched only the file's own first line.
  • It was not declared with mod drift_validator_test; anywhere in lib.rs (module
    list at lines 6‑8, 24‑32, 154), and it was not under tests/.

As a result, validate_drift and DriftEvent::validate_structure had zero executed
coverage despite a test file existing. Additionally, drift_validator.rs:33 imported
FixedOffset from chrono, which is unused (only DateTime is used).

Changes

  • Wired the test in at the correct scope. The test module uses super::* and
    references DriftEvent, validate_drift, and DriftError. Those names resolve
    only inside the drift_validator module (where DriftError is imported via
    use crate::drift_error::DriftError;), so the declaration was added inside
    drift_validator.rs rather than at the crate root:

    #[cfg(test)]
    mod drift_validator_test;
  • Removed the unused import. use chrono::{DateTime, FixedOffset};
    use chrono::DateTime;, clearing the unused-import warning.

Verification

  • cargo test --locked (in src/audit-guard) now compiles and runs the drift
    validator tests:
    • test_valid_drift
    • test_exceeds_threshold
    • test_malformed_id
    • test_invalid_timestamp
  • The crate builds with no unused-import warnings from drift_validator.rs.

Files changed

  • src/audit-guard/src/drift_validator.rs

closes #349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire drift_validator_test.rs into the crate so its tests actually run

1 participant