X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fversioncheck.rs;h=f5d03c645df0435b7876033306ef910f0237afcc;hb=e820a03d1c905d58b27d7ac6d85f450f9754ba79;hp=b2a2f416a8f2a434a97e727d7ab219fe96e3c8b2;hpb=66c03f980e235c3364e2f0dcc1fd654a33984c4b;p=rust.git diff --git a/tests/versioncheck.rs b/tests/versioncheck.rs index b2a2f416a8f..f5d03c645df 100644 --- a/tests/versioncheck.rs +++ b/tests/versioncheck.rs @@ -1,15 +1,18 @@ -extern crate clippy_lints; -use clippy_lints::utils::cargo; - #[test] fn check_that_clippy_lints_has_the_same_version_as_clippy() { - let clippy_meta = cargo::metadata().expect("could not obtain cargo metadata"); + let clippy_meta = cargo_metadata::MetadataCommand::new() + .no_deps() + .exec() + .expect("could not obtain cargo metadata"); std::env::set_current_dir(std::env::current_dir().unwrap().join("clippy_lints")).unwrap(); - let clippy_lints_meta = cargo::metadata().expect("could not obtain cargo metadata"); + let clippy_lints_meta = cargo_metadata::MetadataCommand::new() + .no_deps() + .exec() + .expect("could not obtain cargo metadata"); assert_eq!(clippy_lints_meta.packages[0].version, clippy_meta.packages[0].version); for package in &clippy_meta.packages[0].dependencies { if package.name == "clippy_lints" { - assert_eq!(clippy_lints_meta.packages[0].version, package.req[1..]); + assert!(package.req.matches(&clippy_lints_meta.packages[0].version)); return; } }