File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 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 {
369369 match i. attrs . iter ( ) . find ( |attr| attr. check_name ( "should_fail" ) ) {
370370 Some ( attr) => {
371371 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 " ) ) )
373373 . and_then ( |mi| mi. value_str ( ) ) ;
374374 ShouldFail :: Yes ( msg)
375375 }
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ Test Attributes:
374374 #[should_fail] - This function (also labeled with #[test]) will only pass if
375375 the code causes a failure (an assertion failure or panic!)
376376 A message may be provided, which the failure string must
377- contain: #[should_fail(message = "foo")].
377+ contain: #[should_fail(expected = "foo")].
378378 #[ignore] - When applied to a function which is already attributed as a
379379 test, then the test runner will ignore these tests during
380380 normal test runs. Running with --ignored will run these
Original file line number Diff line number Diff line change 1414// ignore-pretty: does not work well with `--test`
1515
1616#[ test]
17- #[ should_fail( message = "foobar" ) ]
17+ #[ should_fail( expected = "foobar" ) ]
1818fn test_foo ( ) {
1919 panic ! ( "blah" )
2020}
Original file line number Diff line number Diff line change 1212// ignore-pretty: does not work well with `--test`
1313
1414#[ test]
15- #[ should_fail( message = "foo" ) ]
15+ #[ should_fail( expected = "foo" ) ]
1616fn test_foo ( ) {
1717 panic ! ( "foo bar" )
1818}
1919
2020#[ test]
21- #[ should_fail( message = "foo" ) ]
21+ #[ should_fail( expected = "foo" ) ]
2222fn test_foo_dynamic ( ) {
2323 panic ! ( "{} bar" , "foo" )
2424}
You can’t perform that action at this time.
0 commit comments