@@ -396,7 +396,7 @@ fn cargo_test_failing_test_in_bin() {
396
396
397
397
#[test]
398
398
fn test_hello() {
399
- assert_eq!(hello(), "nope")
399
+ assert_eq!(hello(), "nope", "NOPE!" )
400
400
}
401
401
"# ,
402
402
)
@@ -420,24 +420,7 @@ hello
420
420
[ERROR] test failed, to rerun pass `--bin foo`
421
421
422
422
"# ] ] )
423
- . with_stdout_data (
424
- str![ [ r#"
425
- running 1 test
426
- test test_hello ... FAILED
427
-
428
- failures:
429
-
430
- ---- test_hello stdout ----
431
- thread 'test_hello' panicked at src/main.rs:12:17:
432
- assertion `left == right` failed
433
- left: "hello"
434
- right: "nope"
435
- failures:
436
- test_hello
437
- ...
438
- "# ] ]
439
- . unordered ( ) ,
440
- )
423
+ . with_stdout_data ( "...\n [..]NOPE![..]\n ..." )
441
424
. with_status ( 101 )
442
425
. run ( ) ;
443
426
}
@@ -449,7 +432,7 @@ fn cargo_test_failing_test_in_test() {
449
432
. file ( "src/main.rs" , r#"pub fn main() { println!("hello"); }"# )
450
433
. file (
451
434
"tests/footest.rs" ,
452
- "#[test] fn test_hello() { assert!(false) }" ,
435
+ r# "#[test] fn test_hello() { assert!(false, "FALSE!" ) }"# ,
453
436
)
454
437
. build ( ) ;
455
438
@@ -476,17 +459,13 @@ hello
476
459
str![ [ r#"
477
460
...
478
461
running 0 tests
462
+ ...
479
463
running 1 test
480
464
test test_hello ... FAILED
481
-
482
- failures:
483
-
484
- ---- test_hello stdout ----
485
- thread 'test_hello' panicked at tests/footest.rs:1:27:
486
- assertion failed: false
487
- failures:
488
- test_hello
489
465
...
466
+ [..]FALSE![..]
467
+ ...
468
+
490
469
"# ] ]
491
470
. unordered ( ) ,
492
471
)
@@ -498,7 +477,10 @@ failures:
498
477
fn cargo_test_failing_test_in_lib ( ) {
499
478
let p = project ( )
500
479
. file ( "Cargo.toml" , & basic_lib_manifest ( "foo" ) )
501
- . file ( "src/lib.rs" , "#[test] fn test_hello() { assert!(false) }" )
480
+ . file (
481
+ "src/lib.rs" ,
482
+ r#"#[test] fn test_hello() { assert!(false, "FALSE!") }"# ,
483
+ )
502
484
. build ( ) ;
503
485
504
486
p. cargo ( "test" )
@@ -512,16 +494,8 @@ fn cargo_test_failing_test_in_lib() {
512
494
. with_stdout_data ( str![ [ r#"
513
495
...
514
496
test test_hello ... FAILED
515
-
516
- failures:
517
-
518
- ---- test_hello stdout ----
519
- ...
520
- thread 'test_hello' panicked at src/lib.rs:1:27:
521
- assertion failed: false
522
497
...
523
- failures:
524
- test_hello
498
+ [..]FALSE![..]
525
499
...
526
500
"# ] ] )
527
501
. with_status ( 101 )
@@ -5528,7 +5502,7 @@ Caused by:
5528
5502
"test exited abnormally; to see the full output pass --nocapture to the harness." ,
5529
5503
)
5530
5504
. with_stderr_data ( str![ [ r#"
5531
- thread 't' panicked at tests/t1.rs:3:26:
5505
+ [..] thread [..] panicked [..] tests/t1.rs[..]
5532
5506
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5533
5507
Caused by:
5534
5508
process didn't exit successfully: `[ROOT]/foo/target/debug/deps/t2-[HASH][EXE] --nocapture` ([EXIT_STATUS]: 4)
0 commit comments