-
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.
- Loading branch information
Showing
3 changed files
with
42 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
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,40 @@ | ||
use crate::support::{clippy_is_available, project, registry::Package}; | ||
|
||
#[cargo_test] | ||
// Clippy should never be considered fresh. | ||
fn clippy_force_rebuild() { | ||
if !clippy_is_available() { | ||
return; | ||
} | ||
|
||
Package::new("dep1", "0.1.0").publish(); | ||
|
||
// This is just a random clippy lint (assertions_on_constants) that | ||
// hopefully won't change much in the future. | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[package] | ||
name = "foo" | ||
version = "0.1.0" | ||
[dependencies] | ||
dep1 = "0.1" | ||
"#, | ||
) | ||
.file("src/lib.rs", "pub fn f() { assert!(true); }") | ||
.build(); | ||
|
||
p.cargo("clippy-preview -Zunstable-options -v") | ||
.masquerade_as_nightly_cargo() | ||
.with_stderr_contains("[..]assert!(true)[..]") | ||
.run(); | ||
|
||
// Make sure it runs again. | ||
p.cargo("clippy-preview -Zunstable-options -v") | ||
.masquerade_as_nightly_cargo() | ||
.with_stderr_contains("[FRESH] dep1 v0.1.0") | ||
.with_stderr_contains("[..]assert!(true)[..]") | ||
.run(); | ||
} |
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