Skip to content

Commit

Permalink
Fix the lockfile-compat test
Browse files Browse the repository at this point in the history
The newest version of `tar` tweaks the checksum here slightly as the tarball is
slightly different, so this just updates the test to pull the checksum from the
publication rather than hardcoding it.
  • Loading branch information
alexcrichton committed Nov 29, 2017
1 parent 6a1aee0 commit a0dfbb7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/lockfile-compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

#[test]
fn frozen_flag_preserves_old_lockfile() {
Package::new("foo", "0.1.0").publish();
let cksum = Package::new("foo", "0.1.0").publish();

let old_lockfile =
let old_lockfile = format!(
r#"[root]
name = "zzz"
version = "0.0.1"
Expand All @@ -95,8 +95,10 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9e0a16bdf5c05435698fa27192d89e331b22a26a972c34984f560662544453b"
"#;
"checksum foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "{}"
"#,
cksum,
);

let p = project("bar")
.file("Cargo.toml", r#"
Expand All @@ -109,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
foo = "0.1.0"
"#)
.file("src/lib.rs", "")
.file("Cargo.lock", old_lockfile)
.file("Cargo.lock", &old_lockfile)
.build();

assert_that(p.cargo("build").arg("--locked"),
Expand Down

0 comments on commit a0dfbb7

Please sign in to comment.