Skip to content

Commit 3246d4f

Browse files
committed
Change from message to expected
1 parent 616af6e commit 3246d4f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/libsyntax/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/libtest/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

src/test/run-fail/test-should-fail-bad-message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ignore-pretty: does not work well with `--test`
1515

1616
#[test]
17-
#[should_fail(message = "foobar")]
17+
#[should_fail(expected = "foobar")]
1818
fn test_foo() {
1919
panic!("blah")
2020
}

src/test/run-pass/test-should-fail-good-message.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// ignore-pretty: does not work well with `--test`
1313

1414
#[test]
15-
#[should_fail(message = "foo")]
15+
#[should_fail(expected = "foo")]
1616
fn test_foo() {
1717
panic!("foo bar")
1818
}
1919

2020
#[test]
21-
#[should_fail(message = "foo")]
21+
#[should_fail(expected = "foo")]
2222
fn test_foo_dynamic() {
2323
panic!("{} bar", "foo")
2424
}

0 commit comments

Comments
 (0)