@@ -6,7 +6,7 @@ use cargo::util::context::{
6
6
} ;
7
7
use cargo:: CargoResult ;
8
8
use cargo_test_support:: compare;
9
- use cargo_test_support:: { panic_error , paths, project, symlink_supported, t} ;
9
+ use cargo_test_support:: { paths, project, symlink_supported, t} ;
10
10
use cargo_util_schemas:: manifest:: TomlTrimPaths ;
11
11
use cargo_util_schemas:: manifest:: TomlTrimPathsValue ;
12
12
use cargo_util_schemas:: manifest:: { self as cargo_toml, TomlDebugInfo , VecStringOrBool as VSOB } ;
@@ -222,14 +222,7 @@ pub fn assert_error<E: Borrow<anyhow::Error>>(error: E, msgs: &str) {
222
222
} )
223
223
. collect :: < Vec < _ > > ( )
224
224
. join ( "\n \n " ) ;
225
- assert_match ( msgs, & causes) ;
226
- }
227
-
228
- #[ track_caller]
229
- pub fn assert_match ( expected : & str , actual : & str ) {
230
- if let Err ( e) = compare:: match_exact ( expected, actual, "output" , "" , None ) {
231
- panic_error ( "" , e) ;
232
- }
225
+ compare:: assert_match_exact ( msgs, & causes) ;
233
226
}
234
227
235
228
#[ cargo_test]
@@ -297,7 +290,7 @@ f1 = 1
297
290
let expected = "\
298
291
[WARNING] `[ROOT]/.cargo/config` is deprecated in favor of `config.toml`
299
292
[NOTE] if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`" ;
300
- assert_match ( expected, & output) ;
293
+ compare :: assert_match_exact ( expected, & output) ;
301
294
}
302
295
303
296
#[ cargo_test]
@@ -323,7 +316,7 @@ f1 = 1
323
316
324
317
// It should NOT have warned for the symlink.
325
318
let output = read_output ( gctx) ;
326
- assert_match ( "" , & output) ;
319
+ compare :: assert_match_exact ( "" , & output) ;
327
320
}
328
321
329
322
#[ cargo_test]
@@ -349,7 +342,7 @@ f1 = 1
349
342
350
343
// It should NOT have warned for the symlink.
351
344
let output = read_output ( gctx) ;
352
- assert_match ( "" , & output) ;
345
+ compare :: assert_match_exact ( "" , & output) ;
353
346
}
354
347
355
348
#[ cargo_test]
@@ -375,7 +368,7 @@ f1 = 1
375
368
376
369
// It should NOT have warned for this situation.
377
370
let output = read_output ( gctx) ;
378
- assert_match ( "" , & output) ;
371
+ compare :: assert_match_exact ( "" , & output) ;
379
372
}
380
373
381
374
#[ cargo_test]
@@ -405,7 +398,7 @@ f1 = 2
405
398
let expected = "\
406
399
[WARNING] both `[..]/.cargo/config` and `[..]/.cargo/config.toml` exist. Using `[..]/.cargo/config`
407
400
" ;
408
- assert_match ( expected, & output) ;
401
+ compare :: assert_match_exact ( expected, & output) ;
409
402
}
410
403
411
404
#[ cargo_test]
@@ -439,7 +432,7 @@ unused = 456
439
432
let expected = "\
440
433
warning: unused config key `S.unused` in `[..]/.cargo/config.toml`
441
434
" ;
442
- assert_match ( expected, & output) ;
435
+ compare :: assert_match_exact ( expected, & output) ;
443
436
}
444
437
445
438
#[ cargo_test]
0 commit comments