Skip to content

Commit 69eebbd

Browse files
authored
test: improve week1_day2::test_task2_merge_error (#43)
Previously a bad impl won't panic, because the heap only have one iter.
1 parent e3cd2b7 commit 69eebbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mini-lsm/src/tests/week1_day2.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ fn test_task2_merge_error() {
229229
],
230230
1,
231231
);
232-
let iter = MergeIterator::<MockIterator>::create(vec![Box::new(i1), Box::new(i2)]);
232+
let iter = MergeIterator::<MockIterator>::create(vec![
233+
Box::new(i1.clone()),
234+
Box::new(i1),
235+
Box::new(i2),
236+
]);
233237
// your implementation should correctly throw an error instead of panic
234238
expect_iter_error(iter);
235239
}

0 commit comments

Comments
 (0)