Skip to content

Commit

Permalink
test Debug for Drain
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Aug 17, 2020
1 parent 3dcc07e commit b9b2031
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ where
#[test]
fn debug_binary_heap() {
use std::collections::BinaryHeap;
let heap: BinaryHeap<_> = (0..10).collect();
let mut heap: BinaryHeap<_> = (0..10).collect();
check(heap.par_iter());
check(heap.par_drain());
check(heap.into_par_iter());
}

Expand All @@ -39,14 +40,16 @@ fn debug_hash_map() {
let mut map: HashMap<_, _> = (0..10).enumerate().collect();
check(map.par_iter());
check(map.par_iter_mut());
check(map.par_drain());
check(map.into_par_iter());
}

#[test]
fn debug_hash_set() {
use std::collections::HashSet;
let set: HashSet<_> = (0..10).collect();
let mut set: HashSet<_> = (0..10).collect();
check(set.par_iter());
check(set.par_drain());
check(set.into_par_iter());
}

Expand All @@ -65,6 +68,7 @@ fn debug_vec_deque() {
let mut deque: VecDeque<_> = (0..10).collect();
check(deque.par_iter());
check(deque.par_iter_mut());
check(deque.par_drain(..));
check(deque.into_par_iter());
}

Expand Down Expand Up @@ -104,6 +108,12 @@ fn debug_str() {
check(s.par_split_whitespace());
}

#[test]
fn debug_string() {
let mut s = "a b c d\ne f g".to_string();
s.par_drain(..);
}

#[test]
fn debug_vec() {
let mut v: Vec<_> = (0..10).collect();
Expand All @@ -116,6 +126,7 @@ fn debug_vec() {
check(v.par_windows(42));
check(v.par_split(|x| x % 3 == 0));
check(v.par_split_mut(|x| x % 3 == 0));
check(v.par_drain(..));
check(v.into_par_iter());
}

Expand Down

0 comments on commit b9b2031

Please sign in to comment.