()
| 553 | |
| 554 | #[test] |
| 555 | fn test_attestation_staleness() { |
| 556 | let (repo, id, inputs, _dir) = repo_with_memory(); |
| 557 | let (node, _kp) = attested_node(&inputs); |
| 558 | write_tracked(&repo, &id, &node, &inputs); |
| 559 | |
| 560 | // Fresh against the original inputs. |
| 561 | assert!(matches!( |
| 562 | load_attestation(&repo, &id, &inputs).unwrap(), |
| 563 | Attestation::Fresh(_) |
| 564 | )); |
| 565 | |
| 566 | // Edit the body -> current source hash no longer matches -> Stale. |
| 567 | let edited = MemLiftInputs { |
| 568 | frontmatter: inputs.frontmatter.clone(), |
| 569 | body: format!("{}\n<!-- edited -->", inputs.body), |
| 570 | }; |
| 571 | assert!(matches!( |
| 572 | load_attestation(&repo, &id, &edited).unwrap(), |
| 573 | Attestation::Stale(_) |
| 574 | )); |
| 575 | } |
| 576 | } |
nothing calls this directly
no test coverage detected