Function
create_driver_in_cache_custom
(
cache: &PathBuf,
driver_name: &str,
os_label: &str,
arch_label: &str,
version: &str,
)
Source from the content-addressed store, hash-verified
| 46 | } |
| 47 | |
| 48 | fn create_driver_in_cache_custom( |
| 49 | cache: &PathBuf, |
| 50 | driver_name: &str, |
| 51 | os_label: &str, |
| 52 | arch_label: &str, |
| 53 | version: &str, |
| 54 | ) { |
| 55 | let dir = cache |
| 56 | .join(driver_name) |
| 57 | .join(os_label) |
| 58 | .join(arch_label) |
| 59 | .join(version); |
| 60 | fs::create_dir_all(&dir).unwrap(); |
| 61 | let ext = if os_label == "windows" { ".exe" } else { "" }; |
| 62 | fs::write(dir.join(format!("{}{}", driver_name, ext)), b"fake binary").unwrap(); |
| 63 | } |
| 64 | |
| 65 | #[test] |
| 66 | fn find_latest_from_cache_returns_none_when_empty() { |
Tested by
no test coverage detected