()
| 442 | |
| 443 | #[test] |
| 444 | fn test_attestation_staleness() { |
| 445 | let (repo, id, inputs, _dir) = repo_with_memory(); |
| 446 | let (node, _kp) = attested_node(&inputs); |
| 447 | write_tracked(&repo, &id, &node, &inputs); |
| 448 | |
| 449 | // Fresh against the original inputs. |
| 450 | assert!(matches!( |
| 451 | load_attestation(&repo, &id, &inputs).unwrap(), |
| 452 | Attestation::Fresh(_) |
| 453 | )); |
| 454 | |
| 455 | // Edit the body -> current source hash no longer matches -> Stale. |
| 456 | let edited = MemLiftInputs { |
| 457 | frontmatter: inputs.frontmatter.clone(), |
| 458 | body: format!("{}\n<!-- edited -->", inputs.body), |
| 459 | }; |
| 460 | assert!(matches!( |
| 461 | load_attestation(&repo, &id, &edited).unwrap(), |
| 462 | Attestation::Stale(_) |
| 463 | )); |
| 464 | } |
| 465 | } |
nothing calls this directly
no test coverage detected