()
| 195 | |
| 196 | #[test] |
| 197 | fn test_save_load_roundtrip() { |
| 198 | let (store, _temp) = create_test_store(); |
| 199 | |
| 200 | let original = create_test_change_with_content( |
| 201 | "Test roundtrip", |
| 202 | b"Hello, this is test content for the change!", |
| 203 | ); |
| 204 | |
| 205 | // Save |
| 206 | let hash = store.save_change(&original).expect("Failed to save change"); |
| 207 | |
| 208 | // Clear cache to ensure we read from disk |
| 209 | store.clear_cache(); |
| 210 | |
| 211 | // Load |
| 212 | let loaded = store.load_change(&hash).expect("Failed to load change"); |
| 213 | |
| 214 | // Verify all fields |
| 215 | assert_eq!(original.hashed.header.message, loaded.hashed.header.message); |
| 216 | assert_eq!(original.contents, loaded.contents); |
| 217 | assert_eq!( |
| 218 | original.hashed.header.authors.len(), |
| 219 | loaded.hashed.header.authors.len() |
| 220 | ); |
| 221 | } |
| 222 | |
| 223 | #[test] |
| 224 | fn test_copy_content_span_avoids_full_change_load_on_cache_hit() { |
nothing calls this directly
no test coverage detected