Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ockajak committed Jul 19, 2024
1 parent 670915d commit 5ca7cbb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions tests/extensions/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ where
+ Equal
+ Debug
+ 'a,
C::This<i64, i64>: FromIterator<(i64, i64)> + Equal + Debug,
C::This<i64, i64>: FromIterator<(i64, i64)> + Default + Extend<(i64, i64)> + Equal + Debug,
{
// add
let a = a_source.clone();
Expand Down Expand Up @@ -248,25 +248,25 @@ where
assert_map_equal(e_even, HashMap::new());
assert_map_equal(e_odd, HashMap::new());

// partition_map - FIXME - implement test
// let a = a_source.clone();
// let e = e_source.clone();
// let (a_even, a_odd) = a.partition_map(|(&k, &v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
// assert_map_equal(a_even, HashMap::from([(5, 2),]));
// assert_map_equal(a_odd, HashMap::from([(1, 1), (3, 3),]));
// let (e_even, e_odd) = a.partition_map(|(&k, &v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
// assert_map_equal(e_even, HashMap::new());
// assert_map_equal(e_odd, HashMap::new());

// partition_map_to - FIXME - implement test
// let a = a_source.clone();
// let e = e_source.clone();
// let (a_even, a_odd) = a.partition_map_to(|(k, v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
// assert_map_equal(a_even, HashMap::from([(5, 2),]));
// assert_map_equal(a_odd, HashMap::from([(1, 1), (3, 3),]));
// let (e_even, e_odd) = a.partition_map_to(|(k, v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
// assert_map_equal(e_even, HashMap::new());
// assert_map_equal(e_odd, HashMap::new());
// partition_map
let a = a_source.clone();
let e = e_source.clone();
let (a_even, a_odd) = a.partition_map(|(&k, &v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
assert_map_equal(a_even, HashMap::from([(5, 2),]));
assert_map_equal(a_odd, HashMap::from([(1, 1), (3, 3),]));
let (e_even, e_odd) = e.partition_map(|(&k, &v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
assert_map_equal(e_even, HashMap::new());
assert_map_equal(e_odd, HashMap::new());

// partition_map_to
let a = a_source.clone();
let e = e_source.clone();
let (a_even, a_odd) = a.partition_map_to(|(k, v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
assert_map_equal(a_even, HashMap::from([(5, 2),]));
assert_map_equal(a_odd, HashMap::from([(1, 1), (3, 3),]));
let (e_even, e_odd) = e.partition_map_to(|(k, v)| if k % 2 == 0 { Ok((k + 3, v)) } else { Err((k, v)) });
assert_map_equal(e_even, HashMap::new());
assert_map_equal(e_odd, HashMap::new());

// product_keys
let a = a_source.clone();
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ where
+ Equal
+ Debug
+ 'a,
<C as Map<i64, i64>>::This<i64, i64>: FromIterator<(i64, i64)> + Equal + Debug,
<C as Map<i64, i64>>::This<i64, i64>: FromIterator<(i64, i64)> + Default + Extend<(i64, i64)> + Equal + Debug,
{
test_map(a, b, e);
}

0 comments on commit 5ca7cbb

Please sign in to comment.