()
| 498 | |
| 499 | #[test] |
| 500 | fn test_attestation_staleness() { |
| 501 | let (repo, id, inputs, _dir) = repo_with_intent(); |
| 502 | let (node, _kp) = attested_node(&inputs); |
| 503 | write_tracked(&repo, &id, &node, &inputs); |
| 504 | |
| 505 | // Fresh against the original inputs. |
| 506 | assert!(matches!( |
| 507 | load_attestation(&repo, &id, &inputs).unwrap(), |
| 508 | Attestation::Fresh(_) |
| 509 | )); |
| 510 | |
| 511 | // Simulate an edit to the intent body: the current source hash no longer |
| 512 | // matches the recorded anchor -> Stale. |
| 513 | let edited = LiftInputs { |
| 514 | frontmatter: inputs.frontmatter.clone(), |
| 515 | body: format!("{}\n<!-- edited -->", inputs.body), |
| 516 | }; |
| 517 | assert!(matches!( |
| 518 | load_attestation(&repo, &id, &edited).unwrap(), |
| 519 | Attestation::Stale(_) |
| 520 | )); |
| 521 | } |
| 522 | |
| 523 | #[test] |
| 524 | fn test_legacy_sidecar_raw_arg_fallback_is_found() { |
nothing calls this directly
no test coverage detected