-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read registry as a repository rather than a file tree
Allows for seamless ransition for when rust-lang/cargo#4026 lands Closes #32
- Loading branch information
1 parent
505dfbe
commit 1ec0f2f
Showing
8 changed files
with
62 additions
and
206 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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,28 +1 @@ | ||
mod parse; | ||
|
||
use cargo_update::ops::MainRepoPackage; | ||
use semver::Version as Semver; | ||
use std::env; | ||
use std::fs; | ||
|
||
|
||
#[test] | ||
fn pull_version() { | ||
let mut td = env::temp_dir(); | ||
for chunk in &["cargo_update-test", "MainRepoPackage-pull_version", "registry", "index", "github.com-1ecc6299db9ec823"] { | ||
td.push(chunk); | ||
let _ = fs::create_dir(&td); | ||
} | ||
{ | ||
let mut td = td.clone(); | ||
for chunk in &["ch", "ec"] { | ||
td.push(chunk); | ||
let _ = fs::create_dir(&td); | ||
} | ||
fs::copy("test-data/checksums-versions.json", td.join("checksums")).unwrap(); | ||
} | ||
|
||
let mut pkg = MainRepoPackage::parse("checksums 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)").unwrap(); | ||
pkg.pull_version(&td); | ||
assert_eq!(pkg.newest_version, Some(Semver::parse("0.5.2").unwrap())); | ||
} |
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