From 2c704d8841c30668506ed133badc6124c77049c8 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 10 Aug 2018 08:44:36 +0100 Subject: [PATCH] Add a test for "cargo doc --message-format=short" --- tests/testsuite/doc.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index ca212bf2ff6..ab4742e3cf2 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -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`. +", + ), + ); +}