| 219 | |
| 220 | #[test] |
| 221 | fn test_mixed_patterns() { |
| 222 | let mut int_map = HashMap::new(); |
| 223 | int_map.insert("exact".to_string(), 42); |
| 224 | int_map.insert("greater".to_string(), 100); |
| 225 | int_map.insert("range_val".to_string(), 50); |
| 226 | |
| 227 | let data = TestData { |
| 228 | string_map: HashMap::new(), |
| 229 | int_map, |
| 230 | btree_map: BTreeMap::new(), |
| 231 | nested_map: HashMap::new(), |
| 232 | }; |
| 233 | |
| 234 | // Test mixing different pattern types |
| 235 | assert_struct!(data, TestData { |
| 236 | int_map: #{ |
| 237 | "exact": 42, // Simple pattern |
| 238 | "greater": > 50, // Comparison pattern |
| 239 | "range_val": 25..75, // Range pattern |
| 240 | .. |
| 241 | }, |
| 242 | .. |
| 243 | }); |
| 244 | } |
| 245 | |
| 246 | // Custom map type that only implements len() and get() to test duck typing |
| 247 | #[derive(Debug)] |