| 130 | |
| 131 | #[test] |
| 132 | fn test_nested_patterns() { |
| 133 | let mut nested_map = HashMap::new(); |
| 134 | nested_map.insert( |
| 135 | "item1".to_string(), |
| 136 | TestNested { |
| 137 | value: "test".to_string(), |
| 138 | count: 5, |
| 139 | }, |
| 140 | ); |
| 141 | nested_map.insert( |
| 142 | "item2".to_string(), |
| 143 | TestNested { |
| 144 | value: "example".to_string(), |
| 145 | count: 10, |
| 146 | }, |
| 147 | ); |
| 148 | |
| 149 | let data = TestData { |
| 150 | string_map: HashMap::new(), |
| 151 | int_map: HashMap::new(), |
| 152 | btree_map: BTreeMap::new(), |
| 153 | nested_map, |
| 154 | }; |
| 155 | |
| 156 | // Test nested struct patterns in map values |
| 157 | assert_struct!(data, TestData { |
| 158 | nested_map: #{ |
| 159 | "item1": TestNested { |
| 160 | value: "test", |
| 161 | count: >= 5, |
| 162 | .. |
| 163 | }, |
| 164 | "item2": TestNested { |
| 165 | value: "example", |
| 166 | count: > 5, |
| 167 | .. |
| 168 | }, |
| 169 | }, |
| 170 | .. |
| 171 | }); |
| 172 | } |
| 173 | |
| 174 | #[test] |
| 175 | #[cfg(feature = "regex")] |