test: improve week1_day2::test_task2_merge_error (#43)

Previously a bad impl won't panic, because the heap only have one iter.
This commit is contained in:
xxchan
2024-02-11 23:38:29 +08:00
committed by GitHub
parent e3cd2b7f67
commit 69eebbd848

View File

@@ -229,7 +229,11 @@ fn test_task2_merge_error() {
],
1,
);
let iter = MergeIterator::<MockIterator>::create(vec![Box::new(i1), Box::new(i2)]);
let iter = MergeIterator::<MockIterator>::create(vec![
Box::new(i1.clone()),
Box::new(i1),
Box::new(i2),
]);
// your implementation should correctly throw an error instead of panic
expect_iter_error(iter);
}