@@ -17,13 +17,11 @@ use googletest::matcher::Matcher;
17
17
use googletest:: matchers;
18
18
#[ cfg( not( google3) ) ]
19
19
use googletest:: { contains_each, is_contained_in, unordered_elements_are} ;
20
- use googletest:: { google_test, matcher :: MatcherResult , verify_that, Result } ;
20
+ use googletest:: { google_test, verify_that, Result } ;
21
21
use indoc:: indoc;
22
- use matchers:: {
23
- anything, contains_regex, contains_substring, displays_as, eq, err, ge, not, AndMatcherExt ,
24
- } ;
25
22
#[ cfg( google3) ]
26
23
use matchers:: { contains_each, is_contained_in, unordered_elements_are} ;
24
+ use matchers:: { contains_substring, displays_as, eq, err, ge, not} ;
27
25
use std:: collections:: HashMap ;
28
26
29
27
#[ google_test]
@@ -150,31 +148,6 @@ fn unordered_elements_are_description_mismatch() -> Result<()> {
150
148
)
151
149
}
152
150
153
- #[ google_test]
154
- fn has_correct_description_for_map ( ) -> Result < ( ) > {
155
- // UnorderedElementsAreMatcher maintains references to the matchers, so the
156
- // constituent matchers must live longer. Inside a verify_that! macro, the
157
- // compiler takes care of that, but when the matcher is created separately,
158
- // we must create the constitute matchers separately so that they
159
- // aren't dropped too early.
160
- let matchers = ( ( eq ( 2 ) , eq ( "Two" ) ) , ( eq ( 1 ) , eq ( "One" ) ) , ( eq ( 3 ) , eq ( "Three" ) ) ) ;
161
- let matcher = unordered_elements_are ! [
162
- ( matchers. 0.0 , matchers. 0.1 ) ,
163
- ( matchers. 1.0 , matchers. 1.1 ) ,
164
- ( matchers. 2.0 , matchers. 2.1 )
165
- ] ;
166
- verify_that ! (
167
- Matcher :: <HashMap <u32 , & ' static str >>:: describe( & matcher, MatcherResult :: Matches ) ,
168
- eq( indoc!(
169
- "
170
- contains elements matching in any order:
171
- is equal to 2 => is equal to \" Two\"
172
- is equal to 1 => is equal to \" One\"
173
- is equal to 3 => is equal to \" Three\" "
174
- ) )
175
- )
176
- }
177
-
178
151
#[ google_test]
179
152
fn unordered_elements_are_matches_unordered ( ) -> Result < ( ) > {
180
153
let value = vec ! [ 1 , 2 ] ;
@@ -210,32 +183,6 @@ fn unordered_elements_are_description_no_full_match() -> Result<()> {
210
183
)
211
184
}
212
185
213
- #[ google_test]
214
- fn unordered_elements_are_description_no_full_match_with_map ( ) -> Result < ( ) > {
215
- // UnorderedElementsAreMatcher maintains references to the matchers, so the
216
- // constituent matchers must live longer. Inside a verify_that! macro, the
217
- // compiler takes care of that, but when the matcher is created separately,
218
- // we must create the constitute matchers separately so that they
219
- // aren't dropped too early.
220
- let matchers = ( ( anything ( ) , eq ( 1 ) ) , ( anything ( ) , eq ( 2 ) ) , ( anything ( ) , eq ( 2 ) ) ) ;
221
- let matcher = unordered_elements_are ! [
222
- ( matchers. 0.0 , matchers. 0.1 ) ,
223
- ( matchers. 1.0 , matchers. 1.1 ) ,
224
- ( matchers. 2.0 , matchers. 2.1 ) ,
225
- ] ;
226
- let value: HashMap < u32 , u32 > = HashMap :: from_iter ( [ ( 0 , 1 ) , ( 1 , 1 ) , ( 2 , 2 ) ] ) ;
227
- verify_that ! (
228
- matcher. explain_match( & value) ,
229
- displays_as( contains_regex(
230
- "Actual element 2 => 2 at index [0-2] matched expected element `is anything` => `is equal to 2` at index [0-2]."
231
- ) ) . and( displays_as( contains_regex(
232
- "Actual element [0-1] => [0-1] at index [0-2] did not match any remaining expected element."
233
- ) ) ) . and( displays_as( contains_substring(
234
- "Expected element `is anything` => `is equal to 2` at index 2 did not match any remaining actual element."
235
- ) ) )
236
- )
237
- }
238
-
239
186
#[ google_test]
240
187
fn unordered_elements_are_unmatchable_expected_description_mismatch ( ) -> Result < ( ) > {
241
188
verify_that ! (
0 commit comments