()
| 427 | |
| 428 | #[test] |
| 429 | fn test_iter_changes() { |
| 430 | let (store, _temp) = create_test_store(); |
| 431 | |
| 432 | // Save multiple changes |
| 433 | let mut saved_hashes = Vec::new(); |
| 434 | for i in 0..5 { |
| 435 | let change = create_test_change(&format!("Change {}", i)); |
| 436 | let hash = store.save_change(&change).expect("Failed to save change"); |
| 437 | saved_hashes.push(hash); |
| 438 | } |
| 439 | |
| 440 | // Iterate and collect |
| 441 | let found_hashes: Vec<Hash> = store.iter_changes().filter_map(|r| r.ok()).collect(); |
| 442 | |
| 443 | // All saved changes should be found |
| 444 | assert_eq!(found_hashes.len(), saved_hashes.len()); |
| 445 | for hash in &saved_hashes { |
| 446 | assert!( |
| 447 | found_hashes.contains(hash), |
| 448 | "Should find saved hash {}", |
| 449 | hash.to_base32() |
| 450 | ); |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | #[test] |
| 455 | fn test_count_changes() { |
nothing calls this directly
no test coverage detected