Skip to content

Commit

Permalink
feat: add tests for comparing HashMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis authored and mgattozzi committed Feb 28, 2022
1 parent 64ecf41 commit cfc5f72
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

use assay::assay;
use assay::{assay, assert_eq_sorted};
use std::{
collections::HashMap,
env, fs,
future::Future,
path::PathBuf,
Expand Down Expand Up @@ -36,6 +37,15 @@ fn include() {
assert!(fs::metadata("Cargo.toml")?.is_file());
}

#[assay(should_panic)]
fn hash_map_comparison() {
let map1: HashMap<String, u8> = (0..5).map(|n| (n.to_string(), n)).collect();
let mut map2: HashMap<String, u8> = (0..5).map(|n| (n.to_string(), n)).collect();
// Force the last item to be different
map2.insert("4".to_string(), 5);
assert_eq_sorted!(map1, map2);
}

#[assay]
async fn async_func() {
ReadyOnPoll.await;
Expand Down

0 comments on commit cfc5f72

Please sign in to comment.