|
|
@ -278,6 +278,10 @@ fn hashed_dirname(url: &str, name: &str) -> String { |
|
|
|
format!("{}-{}", name, hex) |
|
|
|
format!("{}-{}", name, hex) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)] |
|
|
|
|
|
|
|
mod tests { |
|
|
|
|
|
|
|
use super::*; |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
fn it_returns_same_hash_for_same_name_and_url() { |
|
|
|
fn it_returns_same_hash_for_same_name_and_url() { |
|
|
|
let name = "wasm-pack"; |
|
|
|
let name = "wasm-pack"; |
|
|
@ -339,3 +343,4 @@ fn it_returns_destination_if_binary_already_exists() { |
|
|
|
assert!(dl.is_ok()); |
|
|
|
assert!(dl.is_ok()); |
|
|
|
assert!(dl.unwrap().is_some()) |
|
|
|
assert!(dl.unwrap().is_some()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|