Skip to content

Commit

Permalink
Fixed some compile errors after a rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan authored and theduke committed May 25, 2023
1 parent 9c950aa commit 23b999d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
32 changes: 14 additions & 18 deletions lib/wasi/src/runtime/resolver/in_memory_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ mod tests {

use crate::runtime::resolver::{
inputs::{DistributionInfo, PackageInfo},
Dependency,
Dependency, WebcHash,
};

use super::*;

const PYTHON: &[u8] = include_bytes!("../../../../c-api/examples/assets/python-0.1.0.wasmer");
const COREUTILS_14: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/coreutils-1.0.14-076508e5-e704-463f-b467-f3d9658fc907.webc");
const COREUTILS_16: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/coreutils-1.0.16-e27dbb4f-2ef2-4b44-b46a-ddd86497c6d7.webc");
const COREUTILS_11: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/coreutils-1.0.11-9d7746ca-694f-11ed-b932-dead3543c068.webc");
const BASH: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/bash-1.0.12-0103d733-1afb-4a56-b0ef-0e124139e996.webc");
const BASH: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/bash-1.0.16-f097441a-a80b-4e0d-87d7-684918ef4bb6.webc");

#[test]
fn load_a_directory_tree() {
let temp = TempDir::new().unwrap();
std::fs::write(temp.path().join("python-0.1.0.webc"), PYTHON).unwrap();
std::fs::write(temp.path().join("coreutils-1.0.14.webc"), COREUTILS_14).unwrap();
std::fs::write(temp.path().join("coreutils-1.0.16.webc"), COREUTILS_16).unwrap();
std::fs::write(temp.path().join("coreutils-1.0.11.webc"), COREUTILS_11).unwrap();
let nested = temp.path().join("nested");
std::fs::create_dir(&nested).unwrap();
Expand All @@ -147,29 +147,25 @@ mod tests {
PackageSummary {
pkg: PackageInfo {
name: "sharrattj/bash".to_string(),
version: "1.0.12".parse().unwrap(),
version: "1.0.16".parse().unwrap(),
dependencies: vec![Dependency {
alias: "coreutils".to_string(),
pkg: "sharrattj/coreutils@^1.0.11".parse().unwrap()
pkg: "sharrattj/coreutils@^1.0.16".parse().unwrap()
}],
commands: ["bash", "sh"]
.iter()
.map(|name| crate::runtime::resolver::Command {
name: name.to_string()
})
.collect(),
entrypoint: None,
commands: vec![crate::runtime::resolver::Command {
name: "bash".to_string(),
}],
entrypoint: Some("bash".to_string()),
},
dist: DistributionInfo {
webc: crate::runtime::resolver::polyfills::url_from_file_path(
bash.canonicalize().unwrap()
)
.unwrap(),
webc_sha256: [
7, 226, 190, 131, 173, 231, 130, 245, 207, 185, 51, 189, 86, 85, 222, 37,
27, 163, 170, 27, 25, 24, 211, 136, 186, 233, 174, 119, 66, 15, 134, 9
]
.into(),
webc_sha256: WebcHash::from_bytes([
161, 101, 23, 194, 244, 92, 186, 213, 143, 33, 200, 128, 238, 23, 185, 174,
180, 195, 144, 145, 78, 17, 227, 159, 118, 64, 83, 153, 0, 205, 253, 215,
]),
},
}
);
Expand Down
2 changes: 0 additions & 2 deletions lib/wasi/src/runtime/resolver/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ mod tests {
assert_eq!(
versions,
[
Version::parse("1.0.0").unwrap(),
Version::parse("1.1.0").unwrap(),
Version::parse("1.2.0").unwrap(),
Version::parse("1.5.0").unwrap(),
]
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/runtime/resolver/web_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ mod tests {
use super::*;

const PYTHON: &[u8] = include_bytes!("../../../../c-api/examples/assets/python-0.1.0.wasmer");
const COREUTILS: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/coreutils-1.0.14-076508e5-e704-463f-b467-f3d9658fc907.webc");
const COREUTILS: &[u8] = include_bytes!("../../../../../tests/integration/cli/tests/webc/coreutils-1.0.16-e27dbb4f-2ef2-4b44-b46a-ddd86497c6d7.webc");
const DUMMY_URL: &str = "http://my-registry.io/some/package";
const DUMMY_URL_HASH: &str = "4D7481F44E1D971A8C60D3C7BD505E2727602CF9369ED623920E029C2BA2351D";

Expand Down

0 comments on commit 23b999d

Please sign in to comment.