From 12385d3a85eae2ab69283f25ffc6625413891b61 Mon Sep 17 00:00:00 2001 From: daladim Date: Mon, 5 Apr 2021 23:04:52 +0200 Subject: [PATCH] [minor] Refactored --- tests/sync.rs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/sync.rs b/tests/sync.rs index 686dc1f..4a30939 100644 --- a/tests/sync.rs +++ b/tests/sync.rs @@ -10,51 +10,44 @@ struct TestFlavour { scenarii: Vec, } +#[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] impl TestFlavour { - #[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] pub fn normal() -> Self { Self{} } - #[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] pub fn first_sync_to_local() -> Self { Self{} } - #[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] pub fn first_sync_to_server() -> Self { Self{} } - #[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] pub fn transient_task() -> Self { Self{} } - #[cfg(feature = "local_calendar_mocks_remote_calendars")] + pub async fn run(&self) { + println!("WARNING: This test required the \"integration_tests\" Cargo feature"); + } +} + +#[cfg(feature = "local_calendar_mocks_remote_calendars")] +impl TestFlavour { pub fn normal() -> Self { Self { scenarii: scenarii::scenarii_basic(), } } - #[cfg(feature = "local_calendar_mocks_remote_calendars")] pub fn first_sync_to_local() -> Self { Self { scenarii: scenarii::scenarii_first_sync_to_local(), } } - #[cfg(feature = "local_calendar_mocks_remote_calendars")] pub fn first_sync_to_server() -> Self { Self { scenarii: scenarii::scenarii_first_sync_to_server(), } } - #[cfg(feature = "local_calendar_mocks_remote_calendars")] pub fn transient_task() -> Self { Self { scenarii: scenarii::scenarii_transient_task(), } } - - #[cfg(not(feature = "local_calendar_mocks_remote_calendars"))] - pub async fn run(&self) { - println!("WARNING: This test required the \"integration_tests\" Cargo feature"); - } - - #[cfg(feature = "local_calendar_mocks_remote_calendars")] pub async fn run(&self) { let mut provider = scenarii::populate_test_provider_before_sync(&self.scenarii).await;