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

This commit is contained in:
Dale Wijnand 2018-08-09 21:13:42 +01:00
parent 28a84e02e5
commit a14f7fe024
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF

View File

@ -722,6 +722,23 @@ fn check_artifacts() {
);
}
#[test]
fn short_message_format() {
let foo = project()
.file("src/lib.rs", "fn foo() { let _x: bool = 'a'; }")
.build();
assert_that(
foo.cargo("check --message-format=short"),
execs().with_status(101).with_stderr_contains(
"\
src/lib.rs:1:27: error[E0308]: mismatched types
error: aborting due to previous error
error: Could not compile `foo`.
",
),
);
}
#[test]
fn proc_macro() {
let p = project()