diff options
Diffstat (limited to 'tests/package_installer.rs')
| -rw-r--r-- | tests/package_installer.rs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/tests/package_installer.rs b/tests/package_installer.rs index e527f14..76d8683 100644 --- a/tests/package_installer.rs +++ b/tests/package_installer.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use alt_controller_image::hasher::{CommandRunner, HasherInstaller, Invocation}; -use alt_controller_image::{BuildPlan, ImageSpec}; use alt_controller_image::package_installer::{AptConfig, PackageInstaller, PackageRequest}; +use alt_controller_image::{BuildPlan, ImageSpec}; #[derive(Default)] struct RecordingRunner { @@ -63,13 +63,15 @@ fn hasher_installer_passes_typed_request_to_initroot_and_install_commands() { #[test] fn package_request_rejects_empty_packages_and_unsafe_apt_config_paths() { assert!(AptConfig::new("").is_err()); - assert!(PackageRequest::new( - PathBuf::from("work"), - AptConfig::new("profiles/apt.conf").expect("valid apt config"), - ["basesystem", ""], - std::iter::empty::<&str>(), - ) - .is_err()); + assert!( + PackageRequest::new( + PathBuf::from("work"), + AptConfig::new("profiles/apt.conf").expect("valid apt config"), + ["basesystem", ""], + std::iter::empty::<&str>(), + ) + .is_err() + ); } #[test] @@ -82,11 +84,21 @@ fn build_plan_compiles_its_typed_package_request() { .package_request("work/alt-controller", "profiles/apt.conf") .expect("compile package request"); - assert_eq!(request.workdir(), std::path::Path::new("work/alt-controller")); - assert_eq!(request.apt_config().as_path(), std::path::Path::new("profiles/apt.conf")); + assert_eq!( + request.workdir(), + std::path::Path::new("work/alt-controller") + ); + assert_eq!( + request.apt_config().as_path(), + std::path::Path::new("profiles/apt.conf") + ); assert_eq!(request.packages()[0], "anacron"); assert!(request.packages().contains(&"apt".to_owned())); assert!(request.packages().contains(&"libiec61850".to_owned())); - assert!(request.packages().contains(&"make-initrd-multipath".to_owned())); + assert!( + request + .packages() + .contains(&"make-initrd-multipath".to_owned()) + ); assert_eq!(request.selectors(), ["^kernel-(image|modules-())-(rt)$"]); } |