style: switch rustfmt to hard tabs; document tests-separate rule in TODO

- rustfmt.toml: hard_tabs = true; whole tree reformatted (no logic changes)
- TODO §0.7: tests live in tests/, never inline #[cfg(test)] in code files
  (legacy inline tests to be migrated, see Backlog)
- TODO: add backlog item for the inline-test migration
This commit is contained in:
Loki 2026-11-15 22:34:29 +01:00
parent d8393e0f39
commit 18a0ffa53d
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
96 changed files with 6542 additions and 6537 deletions

View file

@ -8,17 +8,17 @@ const FIXED_TOKEN: [u8; 32] = *b"rampart-pow-fixed-token-test-v1!";
#[test]
fn solver_output_passes_verifier() {
let mut challenge = Challenge::generate(3);
let nonce = solve(&challenge.challenge_string(), 3).expect("solver must find nonce for difficulty 3");
assert!(challenge.verify(&nonce));
let mut challenge = Challenge::generate(3);
let nonce = solve(&challenge.challenge_string(), 3).expect("solver must find nonce for difficulty 3");
assert!(challenge.verify(&nonce));
}
#[test]
fn verifier_rejects_garbage_and_replay() {
let mut challenge = Challenge::with_token(FIXED_TOKEN, 2);
assert!(!challenge.verify("garbage"));
let mut challenge = Challenge::with_token(FIXED_TOKEN, 2);
assert!(!challenge.verify("garbage"));
let nonce = solve(&challenge.challenge_string(), 2).expect("solved");
assert!(challenge.verify(&nonce), "first use passes");
assert!(!challenge.verify(&nonce), "replay is rejected");
let nonce = solve(&challenge.challenge_string(), 2).expect("solved");
assert!(challenge.verify(&nonce), "first use passes");
assert!(!challenge.verify(&nonce), "replay is rejected");
}