()
| 1094 | |
| 1095 | #[test] |
| 1096 | fn test_multiple_changes() { |
| 1097 | let store = MemoryChangeStore::new(); |
| 1098 | |
| 1099 | let changes: Vec<_> = (0..10) |
| 1100 | .map(|i| { |
| 1101 | let content = format!("Content {}", i); |
| 1102 | let change = create_test_change(&format!("Change {}", i), content.as_bytes()); |
| 1103 | let hash = change.hash().unwrap(); |
| 1104 | store.insert(hash, change); |
| 1105 | (hash, content) |
| 1106 | }) |
| 1107 | .collect(); |
| 1108 | |
| 1109 | // Verify all can be retrieved |
| 1110 | for (hash, expected_content) in &changes { |
| 1111 | let loaded = store.get_change(hash).unwrap(); |
| 1112 | assert_eq!( |
| 1113 | std::str::from_utf8(&loaded.contents).unwrap(), |
| 1114 | expected_content |
| 1115 | ); |
| 1116 | } |
| 1117 | |
| 1118 | assert_eq!(store.len(), 10); |
| 1119 | } |
| 1120 | } |
nothing calls this directly
no test coverage detected