()
| 480 | |
| 481 | #[test] |
| 482 | fn test_attestation_staleness() { |
| 483 | let (repo, id, inputs, _dir) = repo_with_intent(); |
| 484 | let (node, _kp) = attested_node(&inputs); |
| 485 | write_tracked(&repo, &id, &node, &inputs); |
| 486 | |
| 487 | // Fresh against the original inputs. |
| 488 | assert!(matches!( |
| 489 | load_attestation(&repo, &id, &inputs).unwrap(), |
| 490 | Attestation::Fresh(_) |
| 491 | )); |
| 492 | |
| 493 | // Simulate an edit to the intent body: the current source hash no longer |
| 494 | // matches the recorded anchor -> Stale. |
| 495 | let edited = LiftInputs { |
| 496 | frontmatter: inputs.frontmatter.clone(), |
| 497 | body: format!("{}\n<!-- edited -->", inputs.body), |
| 498 | }; |
| 499 | assert!(matches!( |
| 500 | load_attestation(&repo, &id, &edited).unwrap(), |
| 501 | Attestation::Stale(_) |
| 502 | )); |
| 503 | } |
| 504 | |
| 505 | #[test] |
| 506 | fn test_legacy_sidecar_raw_arg_fallback_is_found() { |
nothing calls this directly
no test coverage detected