File tree 4 files changed +5
-5
lines changed
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ fn should_fail(i: &ast::Item) -> ShouldFail {
369
369
match i. attrs . iter ( ) . find ( |attr| attr. check_name ( "should_fail" ) ) {
370
370
Some ( attr) => {
371
371
let msg = attr. meta_item_list ( )
372
- . and_then ( |list| list. iter ( ) . find ( |mi| mi. check_name ( "message " ) ) )
372
+ . and_then ( |list| list. iter ( ) . find ( |mi| mi. check_name ( "expected " ) ) )
373
373
. and_then ( |mi| mi. value_str ( ) ) ;
374
374
ShouldFail :: Yes ( msg)
375
375
}
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ Test Attributes:
374
374
#[should_fail] - This function (also labeled with #[test]) will only pass if
375
375
the code causes a failure (an assertion failure or panic!)
376
376
A message may be provided, which the failure string must
377
- contain: #[should_fail(message = "foo")].
377
+ contain: #[should_fail(expected = "foo")].
378
378
#[ignore] - When applied to a function which is already attributed as a
379
379
test, then the test runner will ignore these tests during
380
380
normal test runs. Running with --ignored will run these
Original file line number Diff line number Diff line change 14
14
// ignore-pretty: does not work well with `--test`
15
15
16
16
#[ test]
17
- #[ should_fail( message = "foobar" ) ]
17
+ #[ should_fail( expected = "foobar" ) ]
18
18
fn test_foo ( ) {
19
19
panic ! ( "blah" )
20
20
}
Original file line number Diff line number Diff line change 12
12
// ignore-pretty: does not work well with `--test`
13
13
14
14
#[ test]
15
- #[ should_fail( message = "foo" ) ]
15
+ #[ should_fail( expected = "foo" ) ]
16
16
fn test_foo ( ) {
17
17
panic ! ( "foo bar" )
18
18
}
19
19
20
20
#[ test]
21
- #[ should_fail( message = "foo" ) ]
21
+ #[ should_fail( expected = "foo" ) ]
22
22
fn test_foo_dynamic ( ) {
23
23
panic ! ( "{} bar" , "foo" )
24
24
}
You can’t perform that action at this time.
0 commit comments