()
| 808 | |
| 809 | #[test] |
| 810 | fn vault_entry_roundtrip() { |
| 811 | let entry = VaultEntry::new( |
| 812 | VaultEntryType::Session, |
| 813 | b"# Session transcript\nHello world".to_vec(), |
| 814 | r#"{"developer":"alice"}"#.to_string(), |
| 815 | "2025-01-15T12:00:00Z".to_string(), |
| 816 | ); |
| 817 | |
| 818 | // Verify content hash is populated |
| 819 | assert_ne!(entry.content_hash, [0u8; 32]); |
| 820 | |
| 821 | // Postcard round-trip |
| 822 | let bytes = postcard::to_allocvec(&entry).expect("serialize"); |
| 823 | let decoded: VaultEntry = postcard::from_bytes(&bytes).expect("deserialize"); |
| 824 | |
| 825 | assert_eq!(decoded.entry_type, VaultEntryType::Session); |
| 826 | assert_eq!(decoded.content_bytes, entry.content_bytes); |
| 827 | assert_eq!(decoded.content_hash, entry.content_hash); |
| 828 | assert_eq!(decoded.frontmatter_json, entry.frontmatter_json); |
| 829 | assert_eq!(decoded.created_at, "2025-01-15T12:00:00Z"); |
| 830 | assert_eq!(decoded.updated_at, "2025-01-15T12:00:00Z"); |
| 831 | assert_eq!(decoded.introduced_by, 0); |
| 832 | } |
| 833 | |
| 834 | #[test] |
| 835 | fn vault_entry_content_size() { |
nothing calls this directly
no outgoing calls
no test coverage detected