Add a test for "cargo doc --message-format=short"

This commit is contained in:
Dale Wijnand 2018-08-10 08:44:36 +01:00
parent 99ed7ea800
commit 2c704d8841
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF

View File

@ -1450,3 +1450,21 @@ fn doc_message_format() {
),
);
}
#[test]
fn short_message_format() {
if !is_nightly() {
// This can be removed once 1.30 is stable (rustdoc --error-format stabilized).
return;
}
let p = project().file("src/lib.rs", BAD_INTRA_LINK_LIB).build();
assert_that(
p.cargo("doc --message-format=short"),
execs().with_status(101).with_stderr_contains(
"\
src/lib.rs:4:6: error: `[bad_link]` cannot be resolved, ignoring it...
error: Could not document `foo`.
",
),
);
}