Skip to content

Commit 189db4a

Browse files
committed
Remove manual tests in favor of simpler quickcheck tests (2)
1 parent c6a64b2 commit 189db4a

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

tests/specializations.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,37 +72,17 @@ fn test_specializations<IterItem, Iter>(
7272
}
7373
}
7474

75-
fn put_back_test(test_vec: Vec<i32>) {
76-
{
77-
// Lexical lifetimes support
78-
let pb = itertools::put_back(test_vec.iter());
79-
test_specializations(&pb);
80-
}
81-
82-
let mut pb = itertools::put_back(test_vec.into_iter());
83-
pb.put_back(1);
84-
test_specializations(&pb);
85-
}
86-
8775
quickcheck! {
8876
fn put_back_qc(test_vec: Vec<i32>) -> () {
89-
put_back_test(test_vec)
77+
test_specializations(&itertools::put_back(test_vec.iter()));
78+
let mut pb = itertools::put_back(test_vec.into_iter());
79+
pb.put_back(1);
80+
test_specializations(&pb);
9081
}
9182
}
9283

93-
fn merge_join_by_test(i1: Vec<usize>, i2: Vec<usize>) {
94-
let i1 = i1.into_iter();
95-
let i2 = i2.into_iter();
96-
let mjb = i1.clone().merge_join_by(i2.clone(), std::cmp::Ord::cmp);
97-
test_specializations(&mjb);
98-
99-
// And the other way around
100-
let mjb = i2.merge_join_by(i1, std::cmp::Ord::cmp);
101-
test_specializations(&mjb);
102-
}
103-
10484
quickcheck! {
10585
fn merge_join_by_qc(i1: Vec<usize>, i2: Vec<usize>) -> () {
106-
merge_join_by_test(i1, i2)
86+
test_specializations(&i1.into_iter().merge_join_by(i2.into_iter(), std::cmp::Ord::cmp));
10787
}
10888
}

0 commit comments

Comments
 (0)