()
| 361 | |
| 362 | #[test] |
| 363 | fn test_iter_changes() { |
| 364 | let (store, _temp) = create_test_store(); |
| 365 | |
| 366 | // Save multiple changes |
| 367 | let mut saved_hashes = Vec::new(); |
| 368 | for i in 0..5 { |
| 369 | let change = create_test_change(&format!("Change {}", i)); |
| 370 | let hash = store.save_change(&change).expect("Failed to save change"); |
| 371 | saved_hashes.push(hash); |
| 372 | } |
| 373 | |
| 374 | // Iterate and collect |
| 375 | let found_hashes: Vec<Hash> = store.iter_changes().filter_map(|r| r.ok()).collect(); |
| 376 | |
| 377 | // All saved changes should be found |
| 378 | assert_eq!(found_hashes.len(), saved_hashes.len()); |
| 379 | for hash in &saved_hashes { |
| 380 | assert!( |
| 381 | found_hashes.contains(hash), |
| 382 | "Should find saved hash {}", |
| 383 | hash.to_base32() |
| 384 | ); |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | #[test] |
| 389 | fn test_count_changes() { |
nothing calls this directly
no test coverage detected