MCPcopy Create free account
hub / github.com/carllerche/assert-struct / test_partial_map_matching

Function test_partial_map_matching

assert-struct/tests/maps.rs:41–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40#[test]
41fn test_partial_map_matching() {
42 let mut string_map = HashMap::new();
43 string_map.insert("key1".to_string(), "value1".to_string());
44 string_map.insert("key2".to_string(), "value2".to_string());
45 string_map.insert("key3".to_string(), "value3".to_string());
46
47 let data = TestData {
48 string_map,
49 int_map: HashMap::new(),
50 btree_map: BTreeMap::new(),
51 nested_map: HashMap::new(),
52 };
53
54 // Test partial matching - only check some keys
55 assert_struct!(data, TestData {
56 string_map: #{ "key1": "value1", "key3": "value3", .. },
57 ..
58 });
59}
60
61#[test]
62fn test_map_with_comparison_operators() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected