-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add UI tests showing parts of diagnostic system
- Loading branch information
Showing
7 changed files
with
262 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use cargo_test_support::prelude::*; | ||
use cargo_test_support::str; | ||
use cargo_test_support::{file, project}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
cargo-features = ["test-dummy-unstable"] | ||
[package] | ||
name = "foo" | ||
version = "0.0.1" | ||
edition = "2015" | ||
authors = [] | ||
im-a-teapot = true | ||
[lints.cargo] | ||
im_a_teapot = "deny" | ||
"#, | ||
) | ||
.file("src/lib.rs", "") | ||
.build(); | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.masquerade_as_nightly_cargo(&["cargo-lints", "test-dummy-unstable"]) | ||
.current_dir(p.root()) | ||
.arg("check") | ||
.arg("-Zcargo-lints") | ||
.assert() | ||
.code(101) | ||
.stdout_matches(str![""]) | ||
.stderr_matches(file!["stderr.term.svg"]); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use cargo_test_support::prelude::*; | ||
use cargo_test_support::str; | ||
use cargo_test_support::{file, project}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[workspace] | ||
members = ["foo"] | ||
[workspace.lints.cargo] | ||
im_a_teapot = { level = "warn", priority = 10 } | ||
"#, | ||
) | ||
.file( | ||
"foo/Cargo.toml", | ||
r#" | ||
[package] | ||
name = "foo" | ||
version = "0.0.1" | ||
edition = "2015" | ||
authors = [] | ||
[lints] | ||
workspace = true | ||
"#, | ||
) | ||
.file("foo/src/lib.rs", "") | ||
.build(); | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.masquerade_as_nightly_cargo(&["cargo-lints"]) | ||
.current_dir(p.root()) | ||
.arg("check") | ||
.arg("-Zcargo-lints") | ||
.assert() | ||
.code(101) | ||
.stdout_matches(str![""]) | ||
.stderr_matches(file!["stderr.term.svg"]); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use cargo_test_support::prelude::*; | ||
use cargo_test_support::str; | ||
use cargo_test_support::{file, project}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
cargo-features = ["test-dummy-unstable"] | ||
[package] | ||
name = "foo" | ||
version = "0.0.1" | ||
edition = "2015" | ||
authors = [] | ||
im-a-teapot = true | ||
[lints.cargo] | ||
im_a_teapot = "warn" | ||
"#, | ||
) | ||
.file("src/lib.rs", "") | ||
.build(); | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.masquerade_as_nightly_cargo(&["cargo-lints", "test-dummy-unstable"]) | ||
.current_dir(p.root()) | ||
.arg("check") | ||
.arg("-Zcargo-lints") | ||
.assert() | ||
.success() | ||
.stdout_matches(str![""]) | ||
.stderr_matches(file!["stderr.term.svg"]); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.