()
| 1118 | |
| 1119 | #[test] |
| 1120 | fn test_multiple_changes() { |
| 1121 | let store = MemoryChangeStore::new(); |
| 1122 | |
| 1123 | let changes: Vec<_> = (0..10) |
| 1124 | .map(|i| { |
| 1125 | let content = format!("Content {}", i); |
| 1126 | let change = create_test_change(&format!("Change {}", i), content.as_bytes()); |
| 1127 | let hash = change.hash().unwrap(); |
| 1128 | store.insert(hash, change); |
| 1129 | (hash, content) |
| 1130 | }) |
| 1131 | .collect(); |
| 1132 | |
| 1133 | // Verify all can be retrieved |
| 1134 | for (hash, expected_content) in &changes { |
| 1135 | let loaded = store.get_change(hash).unwrap(); |
| 1136 | assert_eq!( |
| 1137 | std::str::from_utf8(&loaded.contents).unwrap(), |
| 1138 | expected_content |
| 1139 | ); |
| 1140 | } |
| 1141 | |
| 1142 | assert_eq!(store.len(), 10); |
| 1143 | } |
| 1144 | } |
nothing calls this directly
no test coverage detected