#[test]
fn test_create_map() {
let _m = indexmap::indexmap! {
1 => 2,
7 => 1,
2 => 2,
3 => 3,
};
}
#[test]
fn test_create_set() {
let _s = indexmap::indexset! {
1,
7,
2,
3,
};
}
#[test]
fn test_map_shadow() {
const CAP: usize = 42;
let map = -1;
let m = indexmap::indexmap! {
map => CAP,
};
assert_eq!(m[&map], CAP);
assert_eq!(m[0], CAP);
}
#[test]
fn test_map_shadow_default() {
const CAP: usize = 42;
let map = -1;
let m = indexmap::indexmap_with_default! {
fnv::FnvHasher;
map => CAP,
};
assert_eq!(m[&map], CAP);
assert_eq!(m[0], CAP);
}
#[test]
fn test_set_shadow() {
const CAP: usize = 42;
let s = indexmap::indexset!(CAP);
assert_eq!(s[0], CAP);
}
#[test]
fn test_set_shadow_default() {
const CAP: usize = 42;
let s = indexmap::indexset_with_default!(fnv::FnvHasher; CAP);
assert_eq!(s[0], CAP);
}