Skip to content

Commit 2c704d8

Browse files
committed
Add a test for "cargo doc --message-format=short"
1 parent 99ed7ea commit 2c704d8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/testsuite/doc.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,3 +1450,21 @@ fn doc_message_format() {
14501450
),
14511451
);
14521452
}
1453+
1454+
#[test]
1455+
fn short_message_format() {
1456+
if !is_nightly() {
1457+
// This can be removed once 1.30 is stable (rustdoc --error-format stabilized).
1458+
return;
1459+
}
1460+
let p = project().file("src/lib.rs", BAD_INTRA_LINK_LIB).build();
1461+
assert_that(
1462+
p.cargo("doc --message-format=short"),
1463+
execs().with_status(101).with_stderr_contains(
1464+
"\
1465+
src/lib.rs:4:6: error: `[bad_link]` cannot be resolved, ignoring it...
1466+
error: Could not document `foo`.
1467+
",
1468+
),
1469+
);
1470+
}

0 commit comments

Comments
 (0)