Skip to content

Commit 252550e

Browse files
author
Wenjie Li
committed
Add test coverage for API change
1 parent eb2abf5 commit 252550e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/double_priority_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ mod doublepq_tests {
259259
let v = vec![("a", 1), ("b", 2), ("f", 7), ("g", 6), ("h", 5)];
260260
let mut pq: DoublePriorityQueue<_, _> = DoublePriorityQueue::from_iter(v.into_iter());
261261

262-
pq.change_priority_by("z", |z| *z += 8);
262+
assert!(!pq.change_priority_by("z", |z| *z += 8));
263263

264-
pq.change_priority_by("b", |b| *b += 8);
264+
assert!(pq.change_priority_by("b", |b| *b += 8));
265265
assert_eq!(
266266
pq.into_descending_sorted_vec().as_slice(),
267267
&["b", "f", "g", "h", "a"]

tests/priority_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ mod pqueue_tests {
249249
let v = vec![("a", 1), ("b", 2), ("f", 7), ("g", 6), ("h", 5)];
250250
let mut pq: PriorityQueue<_, _> = PriorityQueue::from_iter(v.into_iter());
251251

252-
pq.change_priority_by("b", |b| *b += 8);
252+
assert!(pq.change_priority_by("b", |b| *b += 8));
253253
assert_eq!(pq.into_sorted_vec().as_slice(), &["b", "f", "g", "h", "a"]);
254254
}
255255

0 commit comments

Comments
 (0)