()
| 495 | |
| 496 | #[test] |
| 497 | fn test_attestation_staleness() { |
| 498 | let (repo, id, inputs, _dir) = repo_with_memory(); |
| 499 | let (node, _kp) = attested_node(&inputs); |
| 500 | write_tracked(&repo, &id, &node, &inputs); |
| 501 | |
| 502 | // Fresh against the original inputs. |
| 503 | assert!(matches!( |
| 504 | load_attestation(&repo, &id, &inputs).unwrap(), |
| 505 | Attestation::Fresh(_) |
| 506 | )); |
| 507 | |
| 508 | // Edit the body -> current source hash no longer matches -> Stale. |
| 509 | let edited = MemLiftInputs { |
| 510 | frontmatter: inputs.frontmatter.clone(), |
| 511 | body: format!("{}\n<!-- edited -->", inputs.body), |
| 512 | }; |
| 513 | assert!(matches!( |
| 514 | load_attestation(&repo, &id, &edited).unwrap(), |
| 515 | Attestation::Stale(_) |
| 516 | )); |
| 517 | } |
| 518 | } |
nothing calls this directly
no test coverage detected