diff --git a/src/cleanup_modules/device_cleanup.rs b/src/cleanup_modules/device_cleanup.rs index cb986c0..64110bb 100644 --- a/src/cleanup_modules/device_cleanup.rs +++ b/src/cleanup_modules/device_cleanup.rs @@ -224,3 +224,21 @@ fn is_of_interest(device: &Device) -> bool { candidate_iter(strings) } + +#[tokio::test] +async fn test_init() { + let mut module = DeviceCleanupModule::new(); + let state = State { + dry_run: true, + interactive: false, + use_cache: true, + allow_updates: false, + current_path: Default::default(), + }; + module.initialize(&state).await.unwrap(); + module.get_objects_to_uninstall().iter().for_each(|d| { + regex_cache::cached_match(Some(""), d.device_desc.as_deref()); + regex_cache::cached_match(Some(""), d.manufacturer.as_deref()); + regex_cache::cached_match(Some(""), d.hardware_id.as_deref()); + }); +} diff --git a/src/cleanup_modules/driver_cleanup.rs b/src/cleanup_modules/driver_cleanup.rs index a184a38..fb0d58c 100644 --- a/src/cleanup_modules/driver_cleanup.rs +++ b/src/cleanup_modules/driver_cleanup.rs @@ -186,3 +186,20 @@ fn is_of_interest(driver: &Driver) -> bool { let strings = [driver.inf_original_name(), driver.provider()]; candidate_iter(strings.into_iter().flatten()) } + +#[tokio::test] +async fn test_init() { + let mut module = DriverCleanupModule::new(); + let state = State { + dry_run: true, + interactive: false, + use_cache: true, + allow_updates: false, + current_path: Default::default(), + }; + module.initialize(&state).await.unwrap(); + module.get_objects_to_uninstall().iter().for_each(|d| { + regex_cache::cached_match(Some(""), d.original_name.as_deref()); + regex_cache::cached_match(Some(""), d.provider.as_deref()); + }); +} diff --git a/src/cleanup_modules/driver_package_cleanup.rs b/src/cleanup_modules/driver_package_cleanup.rs index e2f5844..ebb2d62 100644 --- a/src/cleanup_modules/driver_package_cleanup.rs +++ b/src/cleanup_modules/driver_package_cleanup.rs @@ -412,3 +412,21 @@ fn to_command(command: &str) -> std::process::Command { command } + +#[tokio::test] +async fn test_init() { + let mut module = DriverPackageCleanupModule::new(); + let state = State { + dry_run: true, + interactive: false, + use_cache: true, + allow_updates: false, + current_path: Default::default(), + }; + module.initialize(&state).await.unwrap(); + module.get_objects_to_uninstall().iter().for_each(|d| { + regex_cache::cached_match(Some(""), d.display_name.as_deref()); + regex_cache::cached_match(Some(""), d.display_version.as_deref()); + regex_cache::cached_match(Some(""), d.publisher.as_deref()); + }); +}