()
| 505 | |
| 506 | #[test] |
| 507 | fn stale_is_stale_and_na() { |
| 508 | let (repo, ids, _dir) = repo_with_intents(1); |
| 509 | let kp = KeyPair::generate(); |
| 510 | let node = attest_with(&repo, &ids[0], &kp); |
| 511 | write_tracked(&repo, &ids[0], &node); |
| 512 | |
| 513 | // Edit the stored intent body so the recorded source hash no longer |
| 514 | // matches ⇒ load_attestation returns Stale. |
| 515 | let path = bridge::vault_path_for(&repo, &ids[0]).unwrap().unwrap(); |
| 516 | let entry = repo.vault_retrieve(&path).unwrap().unwrap(); |
| 517 | let mut body = String::from_utf8_lossy(&entry.content_bytes).into_owned(); |
| 518 | body.push_str("\n<!-- edited after attest -->\n"); |
| 519 | repo.vault_store( |
| 520 | &path, |
| 521 | VaultEntryType::Intent, |
| 522 | body.into_bytes(), |
| 523 | entry.frontmatter_json.clone(), |
| 524 | ) |
| 525 | .unwrap(); |
| 526 | |
| 527 | let row = row_for(&repo, &ids[0], Some(&kp)); |
| 528 | assert_eq!(row.attested, Attested::Stale); |
| 529 | assert_eq!(row.verifies, Verifies::Na, "stale ⇒ verifies '–', not '✗'"); |
| 530 | assert_eq!(row.attested.table(), "stale"); |
| 531 | } |
| 532 | |
| 533 | #[test] |
| 534 | fn tampered_same_signer_is_x() { |
nothing calls this directly
no test coverage detected