()
| 460 | |
| 461 | #[test] |
| 462 | fn confirmation_codes_are_unique() { |
| 463 | let codes: Vec<_> = (0..10).map(|_| generate_confirmation_code()).collect(); |
| 464 | // While theoretically possible to collide, 10 codes from a 32^7 space |
| 465 | // should practically never collide. |
| 466 | let unique: std::collections::HashSet<_> = codes.iter().collect(); |
| 467 | assert!( |
| 468 | unique.len() > 1, |
| 469 | "codes should be random, got all identical: {codes:?}" |
| 470 | ); |
| 471 | } |
| 472 | |
| 473 | // --------------------------------------------------------------- |
| 474 | // Origin extraction |
nothing calls this directly
no test coverage detected