Skip to content

Commit

Permalink
tests: update CARGO_HOME_subdirs_are_known()
Browse files Browse the repository at this point in the history
adapt to newly added CACHEDIR.TAG files.

see rust-lang/cargo#10553
  • Loading branch information
matthiaskrgr committed Apr 29, 2022
1 parent f43c4a9 commit 9b917a8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/all_cargo_cache_paths_are_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use walkdir::WalkDir;
#[test]
#[cfg_attr(feature = "offline_tests", ignore)]
fn CARGO_HOME_subdirs_are_known() {
// stuff is inconsistent until cargo 0.41.0 hits stable
// https://github.com/rust-lang/cargo/commit/f7b29716ed0e2d67b38bee23e5acddfc11ea0952
let cargo_v = Command::new("cargo").arg("--version").output().unwrap();
let version_output = String::from_utf8_lossy(&cargo_v.stdout).to_string();
if version_output.contains("1.40") {

//https://github.com/rust-lang/cargo/pull/10553
if version_output.contains("1.60") /*stable */ || version_output.contains("1.61") /* beta*/ {
return;
}

Expand Down Expand Up @@ -121,6 +121,10 @@ fn CARGO_HOME_subdirs_are_known() {
.next()
.unwrap()
.starts_with("target/cargo_home_subdirs_known_CARGO_HOME/git"));
assert!(x
.next()
.unwrap()
.starts_with("target/cargo_home_subdirs_known_CARGO_HOME/git/CACHEDIR.TAG"));
/* assert!(x
.next()
.unwrap()
Expand All @@ -144,6 +148,10 @@ fn CARGO_HOME_subdirs_are_known() {
.next()
.unwrap()
.starts_with("target/cargo_home_subdirs_known_CARGO_HOME/registry"));
assert!(x
.next()
.unwrap()
.starts_with("target/cargo_home_subdirs_known_CARGO_HOME/registry"));
assert!(x
.next()
.unwrap()
Expand Down

0 comments on commit 9b917a8

Please sign in to comment.