tests: Refactor initial_install tests
@@ -573,9 +573,8 @@ fn setup_from_dist_server(
);
}
-#[test]
-fn initial_install() {
- setup(None, GZOnly, &|url,
+fn initial_install(comps: Compressions) {
+ setup(None, comps, &|url,
toolchain,
prefix,
download_cfg,
@@ -598,51 +597,18 @@ fn initial_install() {
}
#[test]
-fn initial_install_xz() {
- setup(None, AddXZ, &|url,
- toolchain,
- prefix,
- download_cfg,
- temp_cfg| {
- update_from_dist(
- url,
- toolchain,
- prefix,
- &[],
- &[],
- download_cfg,
- temp_cfg,
- false,
- )
- .unwrap();
+fn initial_install_gziponly() {
+ initial_install(GZOnly);
+}
- assert!(utils::path_exists(&prefix.path().join("bin/rustc")));
- assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib")));
- });
+#[test]
+fn initial_install_xz() {
+ initial_install(AddXZ);
}
#[test]
fn initial_install_zst() {
- setup(None, AddZStd, &|url,
- toolchain,
- prefix,
- download_cfg,
- temp_cfg| {
- update_from_dist(
- url,
- toolchain,
- prefix,
- &[],
- &[],
- download_cfg,
- temp_cfg,
- false,
- )
- .unwrap();
-
- assert!(utils::path_exists(&prefix.path().join("bin/rustc")));
- assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib")));
- });
+ initial_install(AddZStd);
}
#[test]
