()
| 403 | |
| 404 | #[test] |
| 405 | fn stale_is_stale_and_na() { |
| 406 | let (repo, ids, _dir) = repo_with_intents(1); |
| 407 | let kp = KeyPair::generate(); |
| 408 | let node = attest_with(&repo, &ids[0], &kp); |
| 409 | write_tracked(&repo, &ids[0], &node); |
| 410 | |
| 411 | // Edit the stored intent body so the recorded source hash no longer |
| 412 | // matches ⇒ load_attestation returns Stale. |
| 413 | let path = bridge::vault_path_for(&repo, &ids[0]).unwrap().unwrap(); |
| 414 | let entry = repo.vault_retrieve(&path).unwrap().unwrap(); |
| 415 | let mut body = String::from_utf8_lossy(&entry.content_bytes).into_owned(); |
| 416 | body.push_str("\n<!-- edited after attest -->\n"); |
| 417 | repo.vault_store( |
| 418 | &path, |
| 419 | VaultEntryType::Intent, |
| 420 | body.into_bytes(), |
| 421 | entry.frontmatter_json.clone(), |
| 422 | ) |
| 423 | .unwrap(); |
| 424 | |
| 425 | let row = row_for(&repo, &ids[0], Some(&kp)); |
| 426 | assert_eq!(row.attested, Attested::Stale); |
| 427 | assert_eq!(row.verifies, Verifies::Na, "stale ⇒ verifies '–', not '✗'"); |
| 428 | assert_eq!(row.attested.table(), "stale"); |
| 429 | } |
| 430 | |
| 431 | #[test] |
| 432 | fn tampered_same_signer_is_x() { |
nothing calls this directly
no test coverage detected