Welcome back to the series. If this is your first time here, I recommend https://ryangjchandler.co.uk/posts/rebuilding-composer-in-rust-setting-up-the-command-line-interface so you don't miss out on cool stuff.

#[cfg(test)] mod tests { use super::Downloader; #[test] fn it_can_download_a_file() { let downloader = Downloader::new().unwrap(); let downloaded_file = downloader.download("https://www.rust-lang.org/logos/rust-logo-512x512.png").unwrap(); assert!(downloaded_file.path.exists()); }}

#[test] fn it_tidies_up_after_itself() { let downloader = Downloader::new().unwrap(); let downloaded_file = downloader.download("https://www.rust-lang.org/logos/rust-logo-512x512.png").unwrap(); assert!(downloaded_file.path.exists()); drop(downloader); assert!(!downloaded_file.path.exists()); } running 2 tests test tests::it_can_download_a_file... ok test tests::it_tidies_up_after_itself... ok test result: ok.

In the next part of the series I'll start implementing the actual package resolving stuff.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners