From 0f08abd84e7190f71f92a583b42c81d0eaae6b5a Mon Sep 17 00:00:00 2001 From: aawsome <37850842+aawsome@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:49:16 +0200 Subject: [PATCH] feat(forget)!: Make keep-* Options and add keep-none (#238) Breaking Change: The keep-options for `forget` are now real `Options`. This also adds an additional check which enforces that at least one `keep-*` option is set and adds a new `keep-none` option which can be use as single valid `keep-` option (if you want to remove all snapshots). closes https://github.com/rustic-rs/rustic/issues/1191 --- crates/core/src/commands/forget.rs | 542 +++++++++++++----- ...commands__forget__tests__keep-daily10.snap | 133 +++++ ...eep-daily2,keep-weekly2,keep-monthly6.snap | 130 +++++ ...-weekly2,keep-monthly-1,keep-yearly-1.snap | 144 +++++ ...rget__tests__keep-daily3,keep-weekly4.snap | 124 ++++ ..._commands__forget__tests__keep-daily3.snap | 119 ++++ ...commands__forget__tests__keep-daily30.snap | 173 ++++++ ...p-weekly2,keep-monthly3,keep-yearly10.snap | 140 +++++ ...ds__forget__tests__keep-half-yearly10.snap | 121 ++++ ...ommands__forget__tests__keep-hourly-1.snap | 291 ++++++++++ ...ommands__forget__tests__keep-hourly20.snap | 153 +++++ ...commands__forget__tests__keep-ids23ef.snap | 117 ++++ ...get__tests__keep-last-1,keep-hourly-1.snap | 398 +++++++++++++ ..._commands__forget__tests__keep-last-1.snap | 309 ++++++++++ ..._commands__forget__tests__keep-last10.snap | 133 +++++ ..._commands__forget__tests__keep-last15.snap | 143 +++++ ...orget__tests__keep-last2,keep-daily10.snap | 135 +++++ ...commands__forget__tests__keep-last200.snap | 309 ++++++++++ ...forget__tests__keep-last5,keep-daily5.snap | 129 +++++ ..._commands__forget__tests__keep-last99.snap | 309 ++++++++++ ...ommands__forget__tests__keep-monthly6.snap | 125 ++++ ...ommands__forget__tests__keep-nonetrue.snap | 113 ++++ ..._forget__tests__keep-quarter-yearly10.snap | 125 ++++ ...ands__forget__tests__keep-tagsbar,foo.snap | 309 ++++++++++ ...commands__forget__tests__keep-tagsfoo.snap | 303 ++++++++++ ...commands__forget__tests__keep-weekly2.snap | 117 ++++ ...commands__forget__tests__keep-weekly4.snap | 121 ++++ ...ep-within-daily1year 2months 3days 3h.snap | 219 +++++++ ...hin-half-yearly1year 2months 3days 3h.snap | 119 ++++ ...p-within-hourly1year 2months 3days 3h.snap | 227 ++++++++ ...-within-monthly1year 2months 3days 3h.snap | 125 ++++ ...-quarter-yearly1year 2months 3days 3h.snap | 121 ++++ ...p-within-weekly1year 2months 3days 3h.snap | 151 +++++ ...p-within-yearly1year 2months 3days 3h.snap | 119 ++++ ..._forget__tests__keep-within13days 23h.snap | 131 +++++ ...mands__forget__tests__keep-within1day.snap | 115 ++++ ...thly1year,keep-within-yearly9999years.snap | 140 +++++ ...ommands__forget__tests__keep-within1m.snap | 115 ++++ ...rget__tests__keep-within1month 14days.snap | 151 +++++ ...__tests__keep-within1year 1month 1day.snap | 233 ++++++++ ...ts__keep-within1year 2months 3days 3h.snap | 243 ++++++++ ...ands__forget__tests__keep-within2days.snap | 115 ++++ ..._forget__tests__keep-within2months 2h.snap | 157 +++++ ...ands__forget__tests__keep-within7days.snap | 119 ++++ ...ommands__forget__tests__keep-yearly10.snap | 121 ++++ crates/core/src/error.rs | 2 + crates/core/src/repository.rs | 2 +- 47 files changed, 7854 insertions(+), 136 deletions(-) create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily2,keep-weekly2,keep-monthly6.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly2,keep-monthly-1,keep-yearly-1.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly4.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily30.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily7,keep-weekly2,keep-monthly3,keep-yearly10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-half-yearly10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly-1.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly20.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-ids23ef.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1,keep-hourly-1.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last15.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last2,keep-daily10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last200.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last5,keep-daily5.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last99.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-monthly6.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-nonetrue.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-quarter-yearly10.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsbar,foo.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsfoo.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly2.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly4.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-daily1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-half-yearly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-hourly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-monthly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-quarter-yearly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-weekly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-yearly1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within13days 23h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1day.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1h,keep-within-hourly1day,keep-within-daily7days,keep-within-weekly1month,keep-within-monthly1year,keep-within-yearly9999years.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1m.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1month 14days.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 1month 1day.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 2months 3days 3h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2days.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2months 2h.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within7days.snap create mode 100644 crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-yearly10.snap diff --git a/crates/core/src/commands/forget.rs b/crates/core/src/commands/forget.rs index 2c5b0c66..797acfe4 100644 --- a/crates/core/src/commands/forget.rs +++ b/crates/core/src/commands/forget.rs @@ -1,13 +1,12 @@ //! `forget` subcommand use chrono::{DateTime, Datelike, Duration, Local, Timelike}; -use derivative::Derivative; use derive_setters::Setters; use serde_derive::{Deserialize, Serialize}; -use serde_with::{serde_as, DisplayFromStr, OneOrMany}; +use serde_with::{serde_as, skip_serializing_none, DisplayFromStr, OneOrMany}; use crate::{ - error::RusticResult, + error::{CommandErrorKind, RusticResult}, id::Id, progress::ProgressBars, repofile::{ @@ -32,7 +31,7 @@ pub struct ForgetGroup { pub snapshots: Vec, } -#[derive(Debug, Serialize)] +#[derive(Debug, Serialize, PartialEq, Eq)] /// This struct enhances `[SnapshotFile]` with the attributes `keep` and `reasons` which indicates if the snapshot should be kept and why. pub struct ForgetSnapshot { /// The snapshot @@ -72,6 +71,10 @@ impl ForgetGroups { /// * `group_by` - The criterion to group snapshots by /// * `filter` - The filter to apply to the snapshots /// +/// # Errors +/// +/// If keep options are not valid +/// /// # Returns /// /// The list of snapshot groups with the corresponding snapshots and forget information @@ -86,20 +89,22 @@ pub(crate) fn get_forget_snapshots( let groups = repo .get_snapshot_group(&[], group_by, filter)? .into_iter() - .map(|(group, snapshots)| ForgetGroup { - group, - snapshots: keep.apply(snapshots, now), + .map(|(group, snapshots)| -> RusticResult<_> { + Ok(ForgetGroup { + group, + snapshots: keep.apply(snapshots, now)?, + }) }) - .collect(); + .collect::>()?; Ok(ForgetGroups(groups)) } #[cfg_attr(feature = "clap", derive(clap::Parser))] #[cfg_attr(feature = "merge", derive(merge::Merge))] +#[skip_serializing_none] #[serde_as] -#[derive(Clone, Debug, PartialEq, Eq, Derivative, Serialize, Deserialize, Setters)] -#[derivative(Default)] +#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize, Setters)] #[serde(default, rename_all = "kebab-case", deny_unknown_fields)] #[setters(into)] #[non_exhaustive] @@ -107,186 +112,119 @@ pub(crate) fn get_forget_snapshots( pub struct KeepOptions { /// Keep snapshots with this taglist (can be specified multiple times) #[cfg_attr(feature = "clap", clap(long, value_name = "TAG[,TAG,..]"))] - #[serde_as(as = "OneOrMany")] #[cfg_attr(feature = "merge", merge(strategy=merge::vec::overwrite_empty))] + #[serde_as(as = "OneOrMany")] + #[serde(skip_serializing_if = "Vec::is_empty")] pub keep_tags: Vec, /// Keep snapshots ids that start with ID (can be specified multiple times) #[cfg_attr(feature = "clap", clap(long = "keep-id", value_name = "ID"))] #[cfg_attr(feature = "merge", merge(strategy=merge::vec::overwrite_empty))] #[serde_as(as = "OneOrMany<_>")] + #[serde(skip_serializing_if = "Vec::is_empty")] pub keep_ids: Vec, /// Keep the last N snapshots (N == -1: keep all snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'l', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'l', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_last: i32, + pub keep_last: Option, /// Keep the last N hourly snapshots (N == -1: keep all hourly snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'H', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'H', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_hourly: i32, + pub keep_hourly: Option, /// Keep the last N daily snapshots (N == -1: keep all daily snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'd', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'd', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_daily: i32, + pub keep_daily: Option, /// Keep the last N weekly snapshots (N == -1: keep all weekly snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'w', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'w', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_weekly: i32, + pub keep_weekly: Option, /// Keep the last N monthly snapshots (N == -1: keep all monthly snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'm', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'm', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_monthly: i32, + pub keep_monthly: Option, /// Keep the last N quarter-yearly snapshots (N == -1: keep all quarter-yearly snapshots) #[cfg_attr( feature = "clap", - clap(long, value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_quarter_yearly: i32, + pub keep_quarter_yearly: Option, /// Keep the last N half-yearly snapshots (N == -1: keep all half-yearly snapshots) #[cfg_attr( feature = "clap", - clap(long, value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_half_yearly: i32, + pub keep_half_yearly: Option, /// Keep the last N yearly snapshots (N == -1: keep all yearly snapshots) #[cfg_attr( feature = "clap", - clap(long, short = 'y', value_name = "N", default_value = "0", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) + clap(long, short = 'y', value_name = "N", allow_hyphen_values = true, value_parser = clap::value_parser!(i32).range(-1..)) )] - #[cfg_attr(feature = "merge", merge(strategy=merge::num::overwrite_zero))] - pub keep_yearly: i32, + pub keep_yearly: Option, /// Keep snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0h") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within: Option, /// Keep hourly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0h") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_hourly: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_hourly: Option, /// Keep daily snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0d") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_daily: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_daily: Option, /// Keep weekly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0w") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_weekly: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_weekly: Option, /// Keep monthly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0m") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_monthly: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_monthly: Option, /// Keep quarter-yearly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0y") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_quarter_yearly: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_quarter_yearly: Option, /// Keep half-yearly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0y") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_half_yearly: humantime::Duration, + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_half_yearly: Option, /// Keep yearly snapshots newer than DURATION relative to latest snapshot - #[cfg_attr( - feature = "clap", - clap(long, value_name = "DURATION", default_value = "0y") - )] - #[derivative(Default(value = "std::time::Duration::ZERO.into()"))] - #[serde_as(as = "DisplayFromStr")] - #[cfg_attr(feature = "merge", merge(strategy=overwrite_zero_duration))] - pub keep_within_yearly: humantime::Duration, -} - -/// Overwrite the value of `left` with `right` if `left` is zero. -/// -/// This is used to overwrite the default values of `KeepOptions` with the values from the config file. -/// -/// # Arguments -/// -/// * `left` - The value to overwrite -/// * `right` - The value to overwrite with -/// -/// # Example -/// -/// ``` -/// use rustic_core::commands::forget::overwrite_zero_duration; -/// use humantime::Duration; -/// -/// let mut left = "0s".parse::().unwrap().into(); -/// let right = "60s".parse::().unwrap().into(); -/// overwrite_zero_duration(&mut left, right); -/// assert_eq!(left, "60s".parse::().unwrap().into()); -/// ``` -#[cfg(feature = "merge")] -pub fn overwrite_zero_duration(left: &mut humantime::Duration, right: humantime::Duration) { - if *left == std::time::Duration::ZERO.into() { - *left = right; - } + #[cfg_attr(feature = "clap", clap(long, value_name = "DURATION"))] + #[serde_as(as = "Option")] + pub keep_within_yearly: Option, + + /// Allow to keep no snapshot + #[cfg_attr(feature = "clap", clap(long))] + #[cfg_attr(feature = "merge", merge(strategy=merge::bool::overwrite_false))] + #[serde(skip_serializing_if = "std::ops::Not::not")] + pub keep_none: bool, } /// Always return false @@ -405,6 +343,29 @@ fn equal_hour(sn1: &SnapshotFile, sn2: &SnapshotFile) -> bool { } impl KeepOptions { + /// Check if `KeepOptions` are valid, i.e. if at least one keep-* option is given. + fn is_valid(&self) -> bool { + !self.keep_tags.is_empty() + || !self.keep_ids.is_empty() + || self.keep_last.is_some() + || self.keep_hourly.is_some() + || self.keep_daily.is_some() + || self.keep_weekly.is_some() + || self.keep_monthly.is_some() + || self.keep_quarter_yearly.is_some() + || self.keep_half_yearly.is_some() + || self.keep_within.is_some() + || self.keep_yearly.is_some() + || self.keep_within_hourly.is_some() + || self.keep_within_daily.is_some() + || self.keep_within_weekly.is_some() + || self.keep_within_monthly.is_some() + || self.keep_within_quarter_yearly.is_some() + || self.keep_within_half_yearly.is_some() + || self.keep_within_yearly.is_some() + || self.keep_none + } + /// Check if the given snapshot matches the keep options. /// /// # Arguments @@ -424,6 +385,14 @@ impl KeepOptions { has_next: bool, latest_time: DateTime, ) -> Vec<&str> { + type MatchParameters<'a> = ( + CheckFunction, + &'a mut Option, + &'a str, + Option, + &'a str, + ); + let mut reason = Vec::new(); let snapshot_id_hex = sn.id.to_hex(); @@ -439,7 +408,7 @@ impl KeepOptions { reason.push("tags"); } - let keep_checks: [(CheckFunction, &mut i32, &str, humantime::Duration, &str); 8] = [ + let keep_checks: [MatchParameters<'_>; 8] = [ ( always_false, &mut self.keep_last, @@ -500,14 +469,18 @@ impl KeepOptions { for (check_fun, counter, reason1, within, reason2) in keep_checks { if !has_next || last.is_none() || !check_fun(sn, last.unwrap()) { - if *counter != 0 { - reason.push(reason1); - if *counter > 0 { - *counter -= 1; + if let Some(counter) = counter { + if *counter != 0 { + reason.push(reason1); + if *counter > 0 { + *counter -= 1; + } } } - if sn.time + Duration::from_std(*within).unwrap() > latest_time { - reason.push(reason2); + if let Some(within) = within { + if sn.time + Duration::from_std(*within).unwrap() > latest_time { + reason.push(reason2); + } } } } @@ -522,6 +495,10 @@ impl KeepOptions { /// * `snapshots` - The list of snapshots to apply the options to /// * `now` - The current time /// + /// # Errors + /// + /// If keep options are not valid + /// /// # Returns /// /// The list of snapshots with the attribute `keep` set to `true` if the snapshot should be kept and @@ -530,11 +507,15 @@ impl KeepOptions { &self, mut snapshots: Vec, now: DateTime, - ) -> Vec { + ) -> RusticResult> { + if !self.is_valid() { + return Err(CommandErrorKind::NoKeepOption.into()); + } + let mut group_keep = self.clone(); let mut snaps = Vec::new(); if snapshots.is_empty() { - return snaps; + return Ok(snaps); } snapshots.sort_unstable_by(|sn1, sn2| sn1.cmp(sn2).reverse()); @@ -564,6 +545,297 @@ impl KeepOptions { reasons: reasons.iter().map(ToString::to_string).collect(), }); } + Ok(snaps) + } +} + +#[cfg(test)] +mod tests { + use std::str::FromStr; + + use crate::repofile::DeleteOption; + + use super::*; + use anyhow::Result; + use chrono::{Local, NaiveDateTime, TimeZone, Utc}; + use humantime::Duration; + use insta::{assert_ron_snapshot, Settings}; + use rstest::{fixture, rstest}; + use serde_json; + + /// for more readable insta output + #[derive(Serialize)] + struct ForgetResult(Vec<(DateTime, bool, Vec)>); + + // helper for parsing times + fn parse_time(time: &str) -> Result> { + let time = NaiveDateTime::parse_from_str(time, "%Y-%m-%d %H:%M:%S")?; + Ok(Local::from_utc_datetime(&Local, &time)) + } + + #[fixture] + fn test_snapshots() -> Vec { + let by_date = [ + "2014-09-01 10:20:30", + "2014-09-02 10:20:30", + "2014-09-05 10:20:30", + "2014-09-06 10:20:30", + "2014-09-08 10:20:30", + "2014-09-09 10:20:30", + "2014-09-10 10:20:30", + "2014-09-11 10:20:30", + "2014-09-20 10:20:30", + "2014-09-22 10:20:30", + "2014-08-08 10:20:30", + "2014-08-10 10:20:30", + "2014-08-12 10:20:30", + "2014-08-13 10:20:30", + "2014-08-15 10:20:30", + "2014-08-18 10:20:30", + "2014-08-20 10:20:30", + "2014-08-21 10:20:30", + "2014-08-22 10:20:30", + "2014-11-18 10:20:30", + "2014-11-20 10:20:30", + "2014-11-21 10:20:30", + "2014-11-22 10:20:30", + "2015-09-01 10:20:30", + "2015-09-02 10:20:30", + "2015-09-05 10:20:30", + "2015-09-06 10:20:30", + "2015-09-08 10:20:30", + "2015-09-09 10:20:30", + "2015-09-10 10:20:30", + "2015-09-11 10:20:30", + "2015-09-20 10:20:30", + "2015-09-22 10:20:30", + "2015-08-08 10:20:30", + "2015-08-10 10:20:30", + "2015-08-12 10:20:30", + "2015-08-13 10:20:30", + "2015-08-15 10:20:30", + "2015-08-18 10:20:30", + "2015-08-20 10:20:30", + "2015-08-21 10:20:30", + "2015-08-22 10:20:30", + "2015-10-01 10:20:30", + "2015-10-02 10:20:30", + "2015-10-05 10:20:30", + "2015-10-06 10:20:30", + "2015-10-08 10:20:30", + "2015-10-09 10:20:30", + "2015-10-10 10:20:30", + "2015-10-11 10:20:30", + "2015-10-20 10:20:30", + "2015-10-22 10:20:30", + "2015-10-22 10:20:30", + "2015-11-08 10:20:30", + "2015-11-10 10:20:30", + "2015-11-12 10:20:30", + "2015-11-13 10:20:30", + "2015-11-15 10:20:30", + "2015-11-18 10:20:30", + "2015-11-20 10:20:30", + "2015-11-21 10:20:30", + "2015-11-22 10:20:30", + "2016-01-01 01:02:03", + "2016-01-01 01:03:03", + "2016-01-01 07:08:03", + "2016-01-03 07:02:03", + "2016-01-04 10:23:03", + "2016-01-04 11:23:03", + "2016-01-04 12:24:03", + "2016-01-04 12:28:03", + "2016-01-04 12:30:03", + "2016-01-04 16:23:03", + "2016-01-07 10:02:03", + "2016-01-08 20:02:03", + "2016-01-09 21:02:03", + "2016-01-12 21:02:03", + "2016-01-12 21:08:03", + "2016-01-18 12:02:03", + ]; + + let by_date_and_id = [ + ( + "2016-01-05 09:02:03", + "23ef833f60639018019262ac63be5b87601ab58d23880bf6a474adea83dbbf8b", + ), + ( + "2016-01-06 08:02:03", + "aca6165188e4ee770bb5c7a959a7c6612121960360a2f898203dc67dd75be8da", + ), + ( + "2016-01-04 12:23:03", + "23ef833d367ddd53bb95cdad23207a1323b770494eae746496094f1db2416c5c", + ), + ]; + + let by_date_and_tag = [ + ("2014-10-01 10:20:30", "foo"), + ("2014-10-02 10:20:30", "foo"), + ("2014-10-05 10:20:30", "foo"), + ("2014-10-06 10:20:30", "foo"), + ("2014-10-08 10:20:30", "foo"), + ("2014-10-09 10:20:30", "foo"), + ("2014-10-10 10:20:30", "foo"), + ("2014-10-11 10:20:30", "foo"), + ("2014-10-20 10:20:30", "foo"), + ("2014-10-22 10:20:30", "foo"), + ("2014-11-08 10:20:30", "foo"), + ("2014-11-10 10:20:30", "foo"), + ("2014-11-12 10:20:30", "foo"), + ("2014-11-13 10:20:30", "foo"), + ("2014-11-15 10:20:30", "foo,bar"), + ("2015-10-22 10:20:30", "foo,bar"), + ("2015-10-22 10:20:30", "foo,bar"), + ]; + + let delete_never = ["2014-09-01 10:25:37"]; + + let delete_at = [ + ("2014-09-01 10:28:37", "2014-09-01 10:28:37"), + ("2014-09-01 10:29:37", "2025-09-01 10:29:37"), + ]; + + let snaps: Vec<_> = by_date + .into_iter() + .map(|time| -> Result<_> { + let opts = &crate::SnapshotOptions::default().time(parse_time(time)?); + Ok(SnapshotFile::from_options(opts)?) + }) + .chain(by_date_and_id.into_iter().map(|(time, id)| -> Result<_> { + let opts = &crate::SnapshotOptions::default().time(parse_time(time)?); + let mut snap = SnapshotFile::from_options(opts)?; + snap.id = Id::from_hex(id)?; + Ok(snap) + })) + .chain( + by_date_and_tag + .into_iter() + .map(|(time, tags)| -> Result<_> { + let opts = &crate::SnapshotOptions::default() + .time(parse_time(time)?) + .tag(vec![StringList::from_str(tags)?]); + Ok(SnapshotFile::from_options(opts)?) + }), + ) + .chain(delete_never.into_iter().map(|time| -> Result<_> { + let opts = &crate::SnapshotOptions::default().time(parse_time(time)?); + let mut snap = SnapshotFile::from_options(opts)?; + snap.delete = DeleteOption::Never; + Ok(snap) + })) + .chain(delete_at.into_iter().map(|(time, delete)| -> Result<_> { + let opts = &crate::SnapshotOptions::default().time(parse_time(time)?); + let mut snap = SnapshotFile::from_options(opts)?; + let delete = parse_time(delete)?; + snap.delete = DeleteOption::After(delete); + Ok(snap) + })) + .collect::>() + .unwrap(); + snaps } + + #[fixture] + fn insta_forget_snapshots_redaction() -> Settings { + let mut settings = Settings::clone_current(); + settings.add_redaction(".**.snapshot", "[snapshot]"); + settings + } + + #[test] + fn apply_empty_snapshots() -> Result<()> { + let now = Local::now(); + let options = KeepOptions::default().keep_last(10); + let result = options.apply(vec![], now)?; + assert!(result.is_empty()); + Ok(()) + } + + #[rstest] + #[case(KeepOptions::default())] + fn test_apply_fails(#[case] options: KeepOptions, test_snapshots: Vec) { + let now = Local::now(); + let result = options.apply(test_snapshots, now); + assert!(result.is_err()); + } + + #[rstest] + #[case(KeepOptions::default().keep_last(10))] + #[case(KeepOptions::default().keep_last(15))] + #[case(KeepOptions::default().keep_last(99))] + #[case(KeepOptions::default().keep_last(200))] + #[case(KeepOptions::default().keep_hourly(20))] + #[case(KeepOptions::default().keep_daily(3))] + #[case(KeepOptions::default().keep_daily(10))] + #[case(KeepOptions::default().keep_daily(30))] + #[case(KeepOptions::default().keep_last(5).keep_daily(5))] + #[case(KeepOptions::default().keep_last(2).keep_daily(10))] + #[case(KeepOptions::default().keep_weekly(2))] + #[case(KeepOptions::default().keep_weekly(4))] + #[case(KeepOptions::default().keep_daily(3).keep_weekly(4))] + #[case(KeepOptions::default().keep_monthly(6))] + #[case(KeepOptions::default().keep_daily(2).keep_weekly(2).keep_monthly(6))] + #[case(KeepOptions::default().keep_yearly(10))] + #[case(KeepOptions::default().keep_quarter_yearly(10))] + #[case(KeepOptions::default().keep_half_yearly(10))] + #[case(KeepOptions::default().keep_daily(7).keep_weekly(2).keep_monthly(3).keep_yearly(10))] + #[case(KeepOptions::default().keep_tags(vec![StringList::from_str("foo")?]))] + #[case(KeepOptions::default().keep_tags(vec![StringList::from_str("foo,bar")?]))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1d").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("2d").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("7d").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1m").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1M14d").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1y1d1M").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("13d23h").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("2M2h").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_hourly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_daily(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_weekly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_monthly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_quarter_yearly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_half_yearly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within_yearly(Duration::from_str("1y2M3d3h").unwrap()))] + #[case(KeepOptions::default().keep_within(Duration::from_str("1h").unwrap()).keep_within_hourly(Duration::from_str("1d").unwrap()).keep_within_daily(Duration::from_str("1w").unwrap()).keep_within_weekly(Duration::from_str("1M").unwrap()).keep_within_monthly(Duration::from_str("1y").unwrap()).keep_within_yearly(Duration::from_str("9999y").unwrap()))] + #[case(KeepOptions::default().keep_last(-1))] + #[case(KeepOptions::default().keep_last(-1).keep_hourly(-1))] + #[case(KeepOptions::default().keep_hourly(-1))] + #[case(KeepOptions::default().keep_daily(3).keep_weekly(2).keep_monthly(-1).keep_yearly(-1))] + #[case(KeepOptions::default().keep_ids(vec!["23ef".to_string()]))] + #[case(KeepOptions::default().keep_none(true))] + fn test_apply( + #[case] options: KeepOptions, + test_snapshots: Vec, + insta_forget_snapshots_redaction: Settings, + ) -> Result<()> { + let now = parse_time("2016-01-18 12:02:03")?; + let result = options.apply(test_snapshots.clone(), now)?; + + // check that a changed current time doesn't change the forget result (note that DeleteOptions are set accordingly) + let now = parse_time("2020-01-18 12:02:03")?; + let result2 = options.apply(test_snapshots, now)?; + assert_eq!(result, result2); + + // more readable output format + let result = ForgetResult( + result + .into_iter() + .map(|s| (s.snapshot.time.into(), s.keep, s.reasons)) + .collect(), + ); + + // good naming of snapshots: serialize into json and remove control chars + let mut options = serde_json::to_string(&options)?; + options.retain(|c| !"{}\":".contains(c)); + + insta_forget_snapshots_redaction.bind(|| { + assert_ron_snapshot!(options, result); + }); + Ok(()) + } } diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily10.snap new file mode 100644 index 00000000..c42f0406 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily10.snap @@ -0,0 +1,133 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "daily", + ]), + ("2016-01-06T08:02:03Z", true, [ + "daily", + ]), + ("2016-01-05T09:02:03Z", true, [ + "daily", + ]), + ("2016-01-04T16:23:03Z", true, [ + "daily", + ]), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "daily", + ]), + ("2016-01-01T07:08:03Z", true, [ + "daily", + ]), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily2,keep-weekly2,keep-monthly6.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily2,keep-weekly2,keep-monthly6.snap new file mode 100644 index 00000000..5011e1dd --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily2,keep-weekly2,keep-monthly6.snap @@ -0,0 +1,130 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + "weekly", + "monthly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "monthly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly2,keep-monthly-1,keep-yearly-1.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly2,keep-monthly-1,keep-yearly-1.snap new file mode 100644 index 00000000..dabfff08 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly2,keep-monthly-1,keep-yearly-1.snap @@ -0,0 +1,144 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + "weekly", + "monthly", + "yearly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "monthly", + "yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "monthly", + "yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", true, [ + "monthly", + ]), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", true, [ + "monthly", + ]), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", true, [ + "monthly", + ]), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "monthly", + "yearly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly4.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly4.snap new file mode 100644 index 00000000..fc8312c5 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3,keep-weekly4.snap @@ -0,0 +1,124 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "weekly", + ]), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3.snap new file mode 100644 index 00000000..b0dd91d8 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily3.snap @@ -0,0 +1,119 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily30.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily30.snap new file mode 100644 index 00000000..0b3f0f03 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily30.snap @@ -0,0 +1,173 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "daily", + ]), + ("2016-01-06T08:02:03Z", true, [ + "daily", + ]), + ("2016-01-05T09:02:03Z", true, [ + "daily", + ]), + ("2016-01-04T16:23:03Z", true, [ + "daily", + ]), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "daily", + ]), + ("2016-01-01T07:08:03Z", true, [ + "daily", + ]), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-21T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-20T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-18T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-15T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-13T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-12T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-10T10:20:30Z", true, [ + "daily", + ]), + ("2015-11-08T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-22T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-11T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-10T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-09T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-08T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-06T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-05T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-02T10:20:30Z", true, [ + "daily", + ]), + ("2015-10-01T10:20:30Z", true, [ + "daily", + ]), + ("2015-09-22T10:20:30Z", true, [ + "daily", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily7,keep-weekly2,keep-monthly3,keep-yearly10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily7,keep-weekly2,keep-monthly3,keep-yearly10.snap new file mode 100644 index 00000000..fdf1d00b --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-daily7,keep-weekly2,keep-monthly3,keep-yearly10.snap @@ -0,0 +1,140 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "daily", + "weekly", + "monthly", + "yearly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "daily", + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "daily", + ]), + ("2016-01-06T08:02:03Z", true, [ + "daily", + ]), + ("2016-01-05T09:02:03Z", true, [ + "daily", + ]), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "monthly", + "yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "yearly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-half-yearly10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-half-yearly10.snap new file mode 100644 index 00000000..c0f95ab4 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-half-yearly10.snap @@ -0,0 +1,121 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "half-yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "half-yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "half-yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "half-yearly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly-1.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly-1.snap new file mode 100644 index 00000000..f769efe5 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly-1.snap @@ -0,0 +1,291 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "hourly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "hourly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "hourly", + ]), + ("2016-01-08T20:02:03Z", true, [ + "hourly", + ]), + ("2016-01-07T10:02:03Z", true, [ + "hourly", + ]), + ("2016-01-06T08:02:03Z", true, [ + "hourly", + ]), + ("2016-01-05T09:02:03Z", true, [ + "hourly", + ]), + ("2016-01-04T16:23:03Z", true, [ + "hourly", + ]), + ("2016-01-04T12:30:03Z", true, [ + "hourly", + ]), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", true, [ + "hourly", + ]), + ("2016-01-04T10:23:03Z", true, [ + "hourly", + ]), + ("2016-01-03T07:02:03Z", true, [ + "hourly", + ]), + ("2016-01-01T07:08:03Z", true, [ + "hourly", + ]), + ("2016-01-01T01:03:03Z", true, [ + "hourly", + ]), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-21T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-20T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-18T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-15T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-13T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-12T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-10T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-08T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-22T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-11T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-10T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-09T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-08T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-06T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-05T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-02T10:20:30Z", true, [ + "hourly", + ]), + ("2015-10-01T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-22T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-20T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-11T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-10T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-09T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-08T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-06T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-05T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-02T10:20:30Z", true, [ + "hourly", + ]), + ("2015-09-01T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-22T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-21T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-20T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-18T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-15T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-13T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-12T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-10T10:20:30Z", true, [ + "hourly", + ]), + ("2015-08-08T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-22T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-21T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-20T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-18T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-15T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-13T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-12T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-10T10:20:30Z", true, [ + "hourly", + ]), + ("2014-11-08T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-22T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-20T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-11T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-10T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-09T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-08T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-06T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-05T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-02T10:20:30Z", true, [ + "hourly", + ]), + ("2014-10-01T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-22T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-20T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-11T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-10T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-09T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-08T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-06T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-05T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-02T10:20:30Z", true, [ + "hourly", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-21T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-20T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-18T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-15T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-13T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-12T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-10T10:20:30Z", true, [ + "hourly", + ]), + ("2014-08-08T10:20:30Z", true, [ + "hourly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly20.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly20.snap new file mode 100644 index 00000000..0b48c1ef --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-hourly20.snap @@ -0,0 +1,153 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "hourly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "hourly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "hourly", + ]), + ("2016-01-08T20:02:03Z", true, [ + "hourly", + ]), + ("2016-01-07T10:02:03Z", true, [ + "hourly", + ]), + ("2016-01-06T08:02:03Z", true, [ + "hourly", + ]), + ("2016-01-05T09:02:03Z", true, [ + "hourly", + ]), + ("2016-01-04T16:23:03Z", true, [ + "hourly", + ]), + ("2016-01-04T12:30:03Z", true, [ + "hourly", + ]), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", true, [ + "hourly", + ]), + ("2016-01-04T10:23:03Z", true, [ + "hourly", + ]), + ("2016-01-03T07:02:03Z", true, [ + "hourly", + ]), + ("2016-01-01T07:08:03Z", true, [ + "hourly", + ]), + ("2016-01-01T01:03:03Z", true, [ + "hourly", + ]), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-21T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-20T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-18T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-15T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-13T10:20:30Z", true, [ + "hourly", + ]), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-ids23ef.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-ids23ef.snap new file mode 100644 index 00000000..eabaf3ab --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-ids23ef.snap @@ -0,0 +1,117 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", false, []), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", true, [ + "id", + ]), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", true, [ + "id", + ]), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1,keep-hourly-1.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1,keep-hourly-1.snap new file mode 100644 index 00000000..7ae47ecd --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1,keep-hourly-1.snap @@ -0,0 +1,398 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-04T12:28:03Z", true, [ + "last", + ]), + ("2016-01-04T12:24:03Z", true, [ + "last", + ]), + ("2016-01-04T12:23:03Z", true, [ + "last", + ]), + ("2016-01-04T11:23:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-04T10:23:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-03T07:02:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-01T07:08:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-01T01:03:03Z", true, [ + "last", + "hourly", + ]), + ("2016-01-01T01:02:03Z", true, [ + "last", + ]), + ("2015-11-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-21T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-18T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-15T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-13T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-12T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-11-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-11T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-09T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-06T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-05T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-02T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-10-01T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-11T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-09T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-06T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-05T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-02T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-09-01T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-21T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-18T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-15T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-13T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-12T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2015-08-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-21T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-18T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-15T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-13T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-12T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-11-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-11T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-09T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-06T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-05T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-02T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-10-01T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-11T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-09T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-08T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-06T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-05T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-02T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "last", + ]), + ("2014-08-22T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-21T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-20T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-18T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-15T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-13T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-12T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-10T10:20:30Z", true, [ + "last", + "hourly", + ]), + ("2014-08-08T10:20:30Z", true, [ + "last", + "hourly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1.snap new file mode 100644 index 00000000..39cb0deb --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last-1.snap @@ -0,0 +1,309 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + ]), + ("2016-01-04T12:28:03Z", true, [ + "last", + ]), + ("2016-01-04T12:24:03Z", true, [ + "last", + ]), + ("2016-01-04T12:23:03Z", true, [ + "last", + ]), + ("2016-01-04T11:23:03Z", true, [ + "last", + ]), + ("2016-01-04T10:23:03Z", true, [ + "last", + ]), + ("2016-01-03T07:02:03Z", true, [ + "last", + ]), + ("2016-01-01T07:08:03Z", true, [ + "last", + ]), + ("2016-01-01T01:03:03Z", true, [ + "last", + ]), + ("2016-01-01T01:02:03Z", true, [ + "last", + ]), + ("2015-11-22T10:20:30Z", true, [ + "last", + ]), + ("2015-11-21T10:20:30Z", true, [ + "last", + ]), + ("2015-11-20T10:20:30Z", true, [ + "last", + ]), + ("2015-11-18T10:20:30Z", true, [ + "last", + ]), + ("2015-11-15T10:20:30Z", true, [ + "last", + ]), + ("2015-11-13T10:20:30Z", true, [ + "last", + ]), + ("2015-11-12T10:20:30Z", true, [ + "last", + ]), + ("2015-11-10T10:20:30Z", true, [ + "last", + ]), + ("2015-11-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-20T10:20:30Z", true, [ + "last", + ]), + ("2015-10-11T10:20:30Z", true, [ + "last", + ]), + ("2015-10-10T10:20:30Z", true, [ + "last", + ]), + ("2015-10-09T10:20:30Z", true, [ + "last", + ]), + ("2015-10-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-06T10:20:30Z", true, [ + "last", + ]), + ("2015-10-05T10:20:30Z", true, [ + "last", + ]), + ("2015-10-02T10:20:30Z", true, [ + "last", + ]), + ("2015-10-01T10:20:30Z", true, [ + "last", + ]), + ("2015-09-22T10:20:30Z", true, [ + "last", + ]), + ("2015-09-20T10:20:30Z", true, [ + "last", + ]), + ("2015-09-11T10:20:30Z", true, [ + "last", + ]), + ("2015-09-10T10:20:30Z", true, [ + "last", + ]), + ("2015-09-09T10:20:30Z", true, [ + "last", + ]), + ("2015-09-08T10:20:30Z", true, [ + "last", + ]), + ("2015-09-06T10:20:30Z", true, [ + "last", + ]), + ("2015-09-05T10:20:30Z", true, [ + "last", + ]), + ("2015-09-02T10:20:30Z", true, [ + "last", + ]), + ("2015-09-01T10:20:30Z", true, [ + "last", + ]), + ("2015-08-22T10:20:30Z", true, [ + "last", + ]), + ("2015-08-21T10:20:30Z", true, [ + "last", + ]), + ("2015-08-20T10:20:30Z", true, [ + "last", + ]), + ("2015-08-18T10:20:30Z", true, [ + "last", + ]), + ("2015-08-15T10:20:30Z", true, [ + "last", + ]), + ("2015-08-13T10:20:30Z", true, [ + "last", + ]), + ("2015-08-12T10:20:30Z", true, [ + "last", + ]), + ("2015-08-10T10:20:30Z", true, [ + "last", + ]), + ("2015-08-08T10:20:30Z", true, [ + "last", + ]), + ("2014-11-22T10:20:30Z", true, [ + "last", + ]), + ("2014-11-21T10:20:30Z", true, [ + "last", + ]), + ("2014-11-20T10:20:30Z", true, [ + "last", + ]), + ("2014-11-18T10:20:30Z", true, [ + "last", + ]), + ("2014-11-15T10:20:30Z", true, [ + "last", + ]), + ("2014-11-13T10:20:30Z", true, [ + "last", + ]), + ("2014-11-12T10:20:30Z", true, [ + "last", + ]), + ("2014-11-10T10:20:30Z", true, [ + "last", + ]), + ("2014-11-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-22T10:20:30Z", true, [ + "last", + ]), + ("2014-10-20T10:20:30Z", true, [ + "last", + ]), + ("2014-10-11T10:20:30Z", true, [ + "last", + ]), + ("2014-10-10T10:20:30Z", true, [ + "last", + ]), + ("2014-10-09T10:20:30Z", true, [ + "last", + ]), + ("2014-10-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-06T10:20:30Z", true, [ + "last", + ]), + ("2014-10-05T10:20:30Z", true, [ + "last", + ]), + ("2014-10-02T10:20:30Z", true, [ + "last", + ]), + ("2014-10-01T10:20:30Z", true, [ + "last", + ]), + ("2014-09-22T10:20:30Z", true, [ + "last", + ]), + ("2014-09-20T10:20:30Z", true, [ + "last", + ]), + ("2014-09-11T10:20:30Z", true, [ + "last", + ]), + ("2014-09-10T10:20:30Z", true, [ + "last", + ]), + ("2014-09-09T10:20:30Z", true, [ + "last", + ]), + ("2014-09-08T10:20:30Z", true, [ + "last", + ]), + ("2014-09-06T10:20:30Z", true, [ + "last", + ]), + ("2014-09-05T10:20:30Z", true, [ + "last", + ]), + ("2014-09-02T10:20:30Z", true, [ + "last", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "last", + ]), + ("2014-08-22T10:20:30Z", true, [ + "last", + ]), + ("2014-08-21T10:20:30Z", true, [ + "last", + ]), + ("2014-08-20T10:20:30Z", true, [ + "last", + ]), + ("2014-08-18T10:20:30Z", true, [ + "last", + ]), + ("2014-08-15T10:20:30Z", true, [ + "last", + ]), + ("2014-08-13T10:20:30Z", true, [ + "last", + ]), + ("2014-08-12T10:20:30Z", true, [ + "last", + ]), + ("2014-08-10T10:20:30Z", true, [ + "last", + ]), + ("2014-08-08T10:20:30Z", true, [ + "last", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last10.snap new file mode 100644 index 00000000..ede809c2 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last10.snap @@ -0,0 +1,133 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + ]), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last15.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last15.snap new file mode 100644 index 00000000..b8fd8a8a --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last15.snap @@ -0,0 +1,143 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + ]), + ("2016-01-04T12:28:03Z", true, [ + "last", + ]), + ("2016-01-04T12:24:03Z", true, [ + "last", + ]), + ("2016-01-04T12:23:03Z", true, [ + "last", + ]), + ("2016-01-04T11:23:03Z", true, [ + "last", + ]), + ("2016-01-04T10:23:03Z", true, [ + "last", + ]), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last2,keep-daily10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last2,keep-daily10.snap new file mode 100644 index 00000000..1e12d707 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last2,keep-daily10.snap @@ -0,0 +1,135 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "daily", + ]), + ("2016-01-06T08:02:03Z", true, [ + "daily", + ]), + ("2016-01-05T09:02:03Z", true, [ + "daily", + ]), + ("2016-01-04T16:23:03Z", true, [ + "daily", + ]), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "daily", + ]), + ("2016-01-01T07:08:03Z", true, [ + "daily", + ]), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last200.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last200.snap new file mode 100644 index 00000000..39cb0deb --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last200.snap @@ -0,0 +1,309 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + ]), + ("2016-01-04T12:28:03Z", true, [ + "last", + ]), + ("2016-01-04T12:24:03Z", true, [ + "last", + ]), + ("2016-01-04T12:23:03Z", true, [ + "last", + ]), + ("2016-01-04T11:23:03Z", true, [ + "last", + ]), + ("2016-01-04T10:23:03Z", true, [ + "last", + ]), + ("2016-01-03T07:02:03Z", true, [ + "last", + ]), + ("2016-01-01T07:08:03Z", true, [ + "last", + ]), + ("2016-01-01T01:03:03Z", true, [ + "last", + ]), + ("2016-01-01T01:02:03Z", true, [ + "last", + ]), + ("2015-11-22T10:20:30Z", true, [ + "last", + ]), + ("2015-11-21T10:20:30Z", true, [ + "last", + ]), + ("2015-11-20T10:20:30Z", true, [ + "last", + ]), + ("2015-11-18T10:20:30Z", true, [ + "last", + ]), + ("2015-11-15T10:20:30Z", true, [ + "last", + ]), + ("2015-11-13T10:20:30Z", true, [ + "last", + ]), + ("2015-11-12T10:20:30Z", true, [ + "last", + ]), + ("2015-11-10T10:20:30Z", true, [ + "last", + ]), + ("2015-11-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-20T10:20:30Z", true, [ + "last", + ]), + ("2015-10-11T10:20:30Z", true, [ + "last", + ]), + ("2015-10-10T10:20:30Z", true, [ + "last", + ]), + ("2015-10-09T10:20:30Z", true, [ + "last", + ]), + ("2015-10-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-06T10:20:30Z", true, [ + "last", + ]), + ("2015-10-05T10:20:30Z", true, [ + "last", + ]), + ("2015-10-02T10:20:30Z", true, [ + "last", + ]), + ("2015-10-01T10:20:30Z", true, [ + "last", + ]), + ("2015-09-22T10:20:30Z", true, [ + "last", + ]), + ("2015-09-20T10:20:30Z", true, [ + "last", + ]), + ("2015-09-11T10:20:30Z", true, [ + "last", + ]), + ("2015-09-10T10:20:30Z", true, [ + "last", + ]), + ("2015-09-09T10:20:30Z", true, [ + "last", + ]), + ("2015-09-08T10:20:30Z", true, [ + "last", + ]), + ("2015-09-06T10:20:30Z", true, [ + "last", + ]), + ("2015-09-05T10:20:30Z", true, [ + "last", + ]), + ("2015-09-02T10:20:30Z", true, [ + "last", + ]), + ("2015-09-01T10:20:30Z", true, [ + "last", + ]), + ("2015-08-22T10:20:30Z", true, [ + "last", + ]), + ("2015-08-21T10:20:30Z", true, [ + "last", + ]), + ("2015-08-20T10:20:30Z", true, [ + "last", + ]), + ("2015-08-18T10:20:30Z", true, [ + "last", + ]), + ("2015-08-15T10:20:30Z", true, [ + "last", + ]), + ("2015-08-13T10:20:30Z", true, [ + "last", + ]), + ("2015-08-12T10:20:30Z", true, [ + "last", + ]), + ("2015-08-10T10:20:30Z", true, [ + "last", + ]), + ("2015-08-08T10:20:30Z", true, [ + "last", + ]), + ("2014-11-22T10:20:30Z", true, [ + "last", + ]), + ("2014-11-21T10:20:30Z", true, [ + "last", + ]), + ("2014-11-20T10:20:30Z", true, [ + "last", + ]), + ("2014-11-18T10:20:30Z", true, [ + "last", + ]), + ("2014-11-15T10:20:30Z", true, [ + "last", + ]), + ("2014-11-13T10:20:30Z", true, [ + "last", + ]), + ("2014-11-12T10:20:30Z", true, [ + "last", + ]), + ("2014-11-10T10:20:30Z", true, [ + "last", + ]), + ("2014-11-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-22T10:20:30Z", true, [ + "last", + ]), + ("2014-10-20T10:20:30Z", true, [ + "last", + ]), + ("2014-10-11T10:20:30Z", true, [ + "last", + ]), + ("2014-10-10T10:20:30Z", true, [ + "last", + ]), + ("2014-10-09T10:20:30Z", true, [ + "last", + ]), + ("2014-10-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-06T10:20:30Z", true, [ + "last", + ]), + ("2014-10-05T10:20:30Z", true, [ + "last", + ]), + ("2014-10-02T10:20:30Z", true, [ + "last", + ]), + ("2014-10-01T10:20:30Z", true, [ + "last", + ]), + ("2014-09-22T10:20:30Z", true, [ + "last", + ]), + ("2014-09-20T10:20:30Z", true, [ + "last", + ]), + ("2014-09-11T10:20:30Z", true, [ + "last", + ]), + ("2014-09-10T10:20:30Z", true, [ + "last", + ]), + ("2014-09-09T10:20:30Z", true, [ + "last", + ]), + ("2014-09-08T10:20:30Z", true, [ + "last", + ]), + ("2014-09-06T10:20:30Z", true, [ + "last", + ]), + ("2014-09-05T10:20:30Z", true, [ + "last", + ]), + ("2014-09-02T10:20:30Z", true, [ + "last", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "last", + ]), + ("2014-08-22T10:20:30Z", true, [ + "last", + ]), + ("2014-08-21T10:20:30Z", true, [ + "last", + ]), + ("2014-08-20T10:20:30Z", true, [ + "last", + ]), + ("2014-08-18T10:20:30Z", true, [ + "last", + ]), + ("2014-08-15T10:20:30Z", true, [ + "last", + ]), + ("2014-08-13T10:20:30Z", true, [ + "last", + ]), + ("2014-08-12T10:20:30Z", true, [ + "last", + ]), + ("2014-08-10T10:20:30Z", true, [ + "last", + ]), + ("2014-08-08T10:20:30Z", true, [ + "last", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last5,keep-daily5.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last5,keep-daily5.snap new file mode 100644 index 00000000..b5789950 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last5,keep-daily5.snap @@ -0,0 +1,129 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + "daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "daily", + ]), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last99.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last99.snap new file mode 100644 index 00000000..39cb0deb --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-last99.snap @@ -0,0 +1,309 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "last", + ]), + ("2016-01-12T21:08:03Z", true, [ + "last", + ]), + ("2016-01-12T21:02:03Z", true, [ + "last", + ]), + ("2016-01-09T21:02:03Z", true, [ + "last", + ]), + ("2016-01-08T20:02:03Z", true, [ + "last", + ]), + ("2016-01-07T10:02:03Z", true, [ + "last", + ]), + ("2016-01-06T08:02:03Z", true, [ + "last", + ]), + ("2016-01-05T09:02:03Z", true, [ + "last", + ]), + ("2016-01-04T16:23:03Z", true, [ + "last", + ]), + ("2016-01-04T12:30:03Z", true, [ + "last", + ]), + ("2016-01-04T12:28:03Z", true, [ + "last", + ]), + ("2016-01-04T12:24:03Z", true, [ + "last", + ]), + ("2016-01-04T12:23:03Z", true, [ + "last", + ]), + ("2016-01-04T11:23:03Z", true, [ + "last", + ]), + ("2016-01-04T10:23:03Z", true, [ + "last", + ]), + ("2016-01-03T07:02:03Z", true, [ + "last", + ]), + ("2016-01-01T07:08:03Z", true, [ + "last", + ]), + ("2016-01-01T01:03:03Z", true, [ + "last", + ]), + ("2016-01-01T01:02:03Z", true, [ + "last", + ]), + ("2015-11-22T10:20:30Z", true, [ + "last", + ]), + ("2015-11-21T10:20:30Z", true, [ + "last", + ]), + ("2015-11-20T10:20:30Z", true, [ + "last", + ]), + ("2015-11-18T10:20:30Z", true, [ + "last", + ]), + ("2015-11-15T10:20:30Z", true, [ + "last", + ]), + ("2015-11-13T10:20:30Z", true, [ + "last", + ]), + ("2015-11-12T10:20:30Z", true, [ + "last", + ]), + ("2015-11-10T10:20:30Z", true, [ + "last", + ]), + ("2015-11-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-22T10:20:30Z", true, [ + "last", + ]), + ("2015-10-20T10:20:30Z", true, [ + "last", + ]), + ("2015-10-11T10:20:30Z", true, [ + "last", + ]), + ("2015-10-10T10:20:30Z", true, [ + "last", + ]), + ("2015-10-09T10:20:30Z", true, [ + "last", + ]), + ("2015-10-08T10:20:30Z", true, [ + "last", + ]), + ("2015-10-06T10:20:30Z", true, [ + "last", + ]), + ("2015-10-05T10:20:30Z", true, [ + "last", + ]), + ("2015-10-02T10:20:30Z", true, [ + "last", + ]), + ("2015-10-01T10:20:30Z", true, [ + "last", + ]), + ("2015-09-22T10:20:30Z", true, [ + "last", + ]), + ("2015-09-20T10:20:30Z", true, [ + "last", + ]), + ("2015-09-11T10:20:30Z", true, [ + "last", + ]), + ("2015-09-10T10:20:30Z", true, [ + "last", + ]), + ("2015-09-09T10:20:30Z", true, [ + "last", + ]), + ("2015-09-08T10:20:30Z", true, [ + "last", + ]), + ("2015-09-06T10:20:30Z", true, [ + "last", + ]), + ("2015-09-05T10:20:30Z", true, [ + "last", + ]), + ("2015-09-02T10:20:30Z", true, [ + "last", + ]), + ("2015-09-01T10:20:30Z", true, [ + "last", + ]), + ("2015-08-22T10:20:30Z", true, [ + "last", + ]), + ("2015-08-21T10:20:30Z", true, [ + "last", + ]), + ("2015-08-20T10:20:30Z", true, [ + "last", + ]), + ("2015-08-18T10:20:30Z", true, [ + "last", + ]), + ("2015-08-15T10:20:30Z", true, [ + "last", + ]), + ("2015-08-13T10:20:30Z", true, [ + "last", + ]), + ("2015-08-12T10:20:30Z", true, [ + "last", + ]), + ("2015-08-10T10:20:30Z", true, [ + "last", + ]), + ("2015-08-08T10:20:30Z", true, [ + "last", + ]), + ("2014-11-22T10:20:30Z", true, [ + "last", + ]), + ("2014-11-21T10:20:30Z", true, [ + "last", + ]), + ("2014-11-20T10:20:30Z", true, [ + "last", + ]), + ("2014-11-18T10:20:30Z", true, [ + "last", + ]), + ("2014-11-15T10:20:30Z", true, [ + "last", + ]), + ("2014-11-13T10:20:30Z", true, [ + "last", + ]), + ("2014-11-12T10:20:30Z", true, [ + "last", + ]), + ("2014-11-10T10:20:30Z", true, [ + "last", + ]), + ("2014-11-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-22T10:20:30Z", true, [ + "last", + ]), + ("2014-10-20T10:20:30Z", true, [ + "last", + ]), + ("2014-10-11T10:20:30Z", true, [ + "last", + ]), + ("2014-10-10T10:20:30Z", true, [ + "last", + ]), + ("2014-10-09T10:20:30Z", true, [ + "last", + ]), + ("2014-10-08T10:20:30Z", true, [ + "last", + ]), + ("2014-10-06T10:20:30Z", true, [ + "last", + ]), + ("2014-10-05T10:20:30Z", true, [ + "last", + ]), + ("2014-10-02T10:20:30Z", true, [ + "last", + ]), + ("2014-10-01T10:20:30Z", true, [ + "last", + ]), + ("2014-09-22T10:20:30Z", true, [ + "last", + ]), + ("2014-09-20T10:20:30Z", true, [ + "last", + ]), + ("2014-09-11T10:20:30Z", true, [ + "last", + ]), + ("2014-09-10T10:20:30Z", true, [ + "last", + ]), + ("2014-09-09T10:20:30Z", true, [ + "last", + ]), + ("2014-09-08T10:20:30Z", true, [ + "last", + ]), + ("2014-09-06T10:20:30Z", true, [ + "last", + ]), + ("2014-09-05T10:20:30Z", true, [ + "last", + ]), + ("2014-09-02T10:20:30Z", true, [ + "last", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "last", + ]), + ("2014-08-22T10:20:30Z", true, [ + "last", + ]), + ("2014-08-21T10:20:30Z", true, [ + "last", + ]), + ("2014-08-20T10:20:30Z", true, [ + "last", + ]), + ("2014-08-18T10:20:30Z", true, [ + "last", + ]), + ("2014-08-15T10:20:30Z", true, [ + "last", + ]), + ("2014-08-13T10:20:30Z", true, [ + "last", + ]), + ("2014-08-12T10:20:30Z", true, [ + "last", + ]), + ("2014-08-10T10:20:30Z", true, [ + "last", + ]), + ("2014-08-08T10:20:30Z", true, [ + "last", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-monthly6.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-monthly6.snap new file mode 100644 index 00000000..06413eca --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-monthly6.snap @@ -0,0 +1,125 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "monthly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "monthly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "monthly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-nonetrue.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-nonetrue.snap new file mode 100644 index 00000000..565daf3f --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-nonetrue.snap @@ -0,0 +1,113 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", false, []), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-quarter-yearly10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-quarter-yearly10.snap new file mode 100644 index 00000000..5b6bb0b1 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-quarter-yearly10.snap @@ -0,0 +1,125 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "quarter-yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "quarter-yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "quarter-yearly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "quarter-yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", true, [ + "quarter-yearly", + ]), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "quarter-yearly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsbar,foo.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsbar,foo.snap new file mode 100644 index 00000000..033ab6ab --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsbar,foo.snap @@ -0,0 +1,309 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "tags", + ]), + ("2016-01-12T21:08:03Z", true, [ + "tags", + ]), + ("2016-01-12T21:02:03Z", true, [ + "tags", + ]), + ("2016-01-09T21:02:03Z", true, [ + "tags", + ]), + ("2016-01-08T20:02:03Z", true, [ + "tags", + ]), + ("2016-01-07T10:02:03Z", true, [ + "tags", + ]), + ("2016-01-06T08:02:03Z", true, [ + "tags", + ]), + ("2016-01-05T09:02:03Z", true, [ + "tags", + ]), + ("2016-01-04T16:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:30:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:28:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:24:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T11:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T10:23:03Z", true, [ + "tags", + ]), + ("2016-01-03T07:02:03Z", true, [ + "tags", + ]), + ("2016-01-01T07:08:03Z", true, [ + "tags", + ]), + ("2016-01-01T01:03:03Z", true, [ + "tags", + ]), + ("2016-01-01T01:02:03Z", true, [ + "tags", + ]), + ("2015-11-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-21T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-18T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-15T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-13T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-12T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-11T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-09T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-06T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-05T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-02T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-01T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-11T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-09T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-06T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-05T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-02T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-01T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-21T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-18T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-15T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-13T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-12T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-21T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-18T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-15T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-13T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-12T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-11T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-09T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-06T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-05T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-02T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-01T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-11T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-09T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-06T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-05T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-02T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-21T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-18T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-15T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-13T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-12T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-08T10:20:30Z", true, [ + "tags", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsfoo.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsfoo.snap new file mode 100644 index 00000000..f19295e3 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-tagsfoo.snap @@ -0,0 +1,303 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "tags", + ]), + ("2016-01-12T21:08:03Z", true, [ + "tags", + ]), + ("2016-01-12T21:02:03Z", true, [ + "tags", + ]), + ("2016-01-09T21:02:03Z", true, [ + "tags", + ]), + ("2016-01-08T20:02:03Z", true, [ + "tags", + ]), + ("2016-01-07T10:02:03Z", true, [ + "tags", + ]), + ("2016-01-06T08:02:03Z", true, [ + "tags", + ]), + ("2016-01-05T09:02:03Z", true, [ + "tags", + ]), + ("2016-01-04T16:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:30:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:28:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:24:03Z", true, [ + "tags", + ]), + ("2016-01-04T12:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T11:23:03Z", true, [ + "tags", + ]), + ("2016-01-04T10:23:03Z", true, [ + "tags", + ]), + ("2016-01-03T07:02:03Z", true, [ + "tags", + ]), + ("2016-01-01T07:08:03Z", true, [ + "tags", + ]), + ("2016-01-01T01:03:03Z", true, [ + "tags", + ]), + ("2016-01-01T01:02:03Z", true, [ + "tags", + ]), + ("2015-11-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-21T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-18T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-15T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-13T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-12T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-11-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-11T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-09T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-06T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-05T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-02T10:20:30Z", true, [ + "tags", + ]), + ("2015-10-01T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-11T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-09T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-08T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-06T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-05T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-02T10:20:30Z", true, [ + "tags", + ]), + ("2015-09-01T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-22T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-21T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-20T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-18T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-15T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-13T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-12T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-10T10:20:30Z", true, [ + "tags", + ]), + ("2015-08-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-21T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-18T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-12T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-11-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-11T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-09T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-06T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-05T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-02T10:20:30Z", true, [ + "tags", + ]), + ("2014-10-01T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-11T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-09T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-08T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-06T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-05T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-02T10:20:30Z", true, [ + "tags", + ]), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-22T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-21T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-20T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-18T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-15T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-13T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-12T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-10T10:20:30Z", true, [ + "tags", + ]), + ("2014-08-08T10:20:30Z", true, [ + "tags", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly2.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly2.snap new file mode 100644 index 00000000..109bfec5 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly2.snap @@ -0,0 +1,117 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "weekly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly4.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly4.snap new file mode 100644 index 00000000..8903060a --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-weekly4.snap @@ -0,0 +1,121 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "weekly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "weekly", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "weekly", + ]), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-daily1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-daily1year 2months 3days 3h.snap new file mode 100644 index 00000000..cb68c041 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-daily1year 2months 3days 3h.snap @@ -0,0 +1,219 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within daily", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within daily", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "within daily", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within daily", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within daily", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within daily", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within daily", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within daily", + ]), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "within daily", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within daily", + ]), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-21T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-20T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-18T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-15T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-13T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-12T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-10T10:20:30Z", true, [ + "within daily", + ]), + ("2015-11-08T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-11T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-10T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-09T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-08T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-06T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-05T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-02T10:20:30Z", true, [ + "within daily", + ]), + ("2015-10-01T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-22T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-20T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-11T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-10T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-09T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-08T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-06T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-05T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-02T10:20:30Z", true, [ + "within daily", + ]), + ("2015-09-01T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-22T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-21T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-20T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-18T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-15T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-13T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-12T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-10T10:20:30Z", true, [ + "within daily", + ]), + ("2015-08-08T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-22T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-21T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-20T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-18T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-15T10:20:30Z", true, [ + "within daily", + ]), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-half-yearly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-half-yearly1year 2months 3days 3h.snap new file mode 100644 index 00000000..74d0dde6 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-half-yearly1year 2months 3days 3h.snap @@ -0,0 +1,119 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within half-yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within half-yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "within half-yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-hourly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-hourly1year 2months 3days 3h.snap new file mode 100644 index 00000000..507b8eb0 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-hourly1year 2months 3days 3h.snap @@ -0,0 +1,227 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within hourly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within hourly", + ]), + ("2016-01-04T12:30:03Z", true, [ + "within hourly", + ]), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", true, [ + "within hourly", + ]), + ("2016-01-04T10:23:03Z", true, [ + "within hourly", + ]), + ("2016-01-03T07:02:03Z", true, [ + "within hourly", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within hourly", + ]), + ("2016-01-01T01:03:03Z", true, [ + "within hourly", + ]), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-21T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-20T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-18T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-15T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-13T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-12T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-10T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-11-08T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-11T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-10T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-09T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-08T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-06T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-05T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-02T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-10-01T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-22T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-20T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-11T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-10T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-09T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-08T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-06T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-05T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-02T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-09-01T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-22T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-21T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-20T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-18T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-15T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-13T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-12T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-10T10:20:30Z", true, [ + "within hourly", + ]), + ("2015-08-08T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-22T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-21T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-20T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-18T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-15T10:20:30Z", true, [ + "within hourly", + ]), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-monthly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-monthly1year 2months 3days 3h.snap new file mode 100644 index 00000000..29b4102f --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-monthly1year 2months 3days 3h.snap @@ -0,0 +1,125 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within monthly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-quarter-yearly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-quarter-yearly1year 2months 3days 3h.snap new file mode 100644 index 00000000..87025011 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-quarter-yearly1year 2months 3days 3h.snap @@ -0,0 +1,121 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within quarter-yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within quarter-yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "within quarter-yearly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "within quarter-yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-weekly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-weekly1year 2months 3days 3h.snap new file mode 100644 index 00000000..180d7dd6 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-weekly1year 2months 3days 3h.snap @@ -0,0 +1,151 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within weekly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "within weekly", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "within weekly", + ]), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-09-20T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-09-11T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", true, [ + "within weekly", + ]), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", true, [ + "within weekly", + ]), + ("2014-11-22T10:20:30Z", true, [ + "within weekly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", true, [ + "within weekly", + ]), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-yearly1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-yearly1year 2months 3days 3h.snap new file mode 100644 index 00000000..5dec1c69 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within-yearly1year 2months 3days 3h.snap @@ -0,0 +1,119 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "within yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within13days 23h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within13days 23h.snap new file mode 100644 index 00000000..d35902c4 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within13days 23h.snap @@ -0,0 +1,131 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", true, [ + "within", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within", + ]), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1day.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1day.snap new file mode 100644 index 00000000..f8c71eda --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1day.snap @@ -0,0 +1,115 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1h,keep-within-hourly1day,keep-within-daily7days,keep-within-weekly1month,keep-within-monthly1year,keep-within-yearly9999years.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1h,keep-within-hourly1day,keep-within-daily7days,keep-within-weekly1month,keep-within-monthly1year,keep-within-yearly9999years.snap new file mode 100644 index 00000000..5cdbc001 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1h,keep-within-hourly1day,keep-within-daily7days,keep-within-weekly1month,keep-within-monthly1year,keep-within-yearly9999years.snap @@ -0,0 +1,140 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + "within hourly", + "within daily", + "within weekly", + "within monthly", + "within yearly", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within daily", + "within weekly", + ]), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", true, [ + "within weekly", + ]), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", true, [ + "within weekly", + ]), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "within monthly", + "within yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", true, [ + "within monthly", + ]), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "within yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "within yearly", + ]), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1m.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1m.snap new file mode 100644 index 00000000..f8c71eda --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1m.snap @@ -0,0 +1,115 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1month 14days.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1month 14days.snap new file mode 100644 index 00000000..73091d41 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1month 14days.snap @@ -0,0 +1,151 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", true, [ + "within", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within", + ]), + ("2016-01-04T12:30:03Z", true, [ + "within", + ]), + ("2016-01-04T12:28:03Z", true, [ + "within", + ]), + ("2016-01-04T12:24:03Z", true, [ + "within", + ]), + ("2016-01-04T12:23:03Z", true, [ + "within", + ]), + ("2016-01-04T11:23:03Z", true, [ + "within", + ]), + ("2016-01-04T10:23:03Z", true, [ + "within", + ]), + ("2016-01-03T07:02:03Z", true, [ + "within", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within", + ]), + ("2016-01-01T01:03:03Z", true, [ + "within", + ]), + ("2016-01-01T01:02:03Z", true, [ + "within", + ]), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 1month 1day.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 1month 1day.snap new file mode 100644 index 00000000..88407c7a --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 1month 1day.snap @@ -0,0 +1,233 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", true, [ + "within", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within", + ]), + ("2016-01-04T12:30:03Z", true, [ + "within", + ]), + ("2016-01-04T12:28:03Z", true, [ + "within", + ]), + ("2016-01-04T12:24:03Z", true, [ + "within", + ]), + ("2016-01-04T12:23:03Z", true, [ + "within", + ]), + ("2016-01-04T11:23:03Z", true, [ + "within", + ]), + ("2016-01-04T10:23:03Z", true, [ + "within", + ]), + ("2016-01-03T07:02:03Z", true, [ + "within", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within", + ]), + ("2016-01-01T01:03:03Z", true, [ + "within", + ]), + ("2016-01-01T01:02:03Z", true, [ + "within", + ]), + ("2015-11-22T10:20:30Z", true, [ + "within", + ]), + ("2015-11-21T10:20:30Z", true, [ + "within", + ]), + ("2015-11-20T10:20:30Z", true, [ + "within", + ]), + ("2015-11-18T10:20:30Z", true, [ + "within", + ]), + ("2015-11-15T10:20:30Z", true, [ + "within", + ]), + ("2015-11-13T10:20:30Z", true, [ + "within", + ]), + ("2015-11-12T10:20:30Z", true, [ + "within", + ]), + ("2015-11-10T10:20:30Z", true, [ + "within", + ]), + ("2015-11-08T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-20T10:20:30Z", true, [ + "within", + ]), + ("2015-10-11T10:20:30Z", true, [ + "within", + ]), + ("2015-10-10T10:20:30Z", true, [ + "within", + ]), + ("2015-10-09T10:20:30Z", true, [ + "within", + ]), + ("2015-10-08T10:20:30Z", true, [ + "within", + ]), + ("2015-10-06T10:20:30Z", true, [ + "within", + ]), + ("2015-10-05T10:20:30Z", true, [ + "within", + ]), + ("2015-10-02T10:20:30Z", true, [ + "within", + ]), + ("2015-10-01T10:20:30Z", true, [ + "within", + ]), + ("2015-09-22T10:20:30Z", true, [ + "within", + ]), + ("2015-09-20T10:20:30Z", true, [ + "within", + ]), + ("2015-09-11T10:20:30Z", true, [ + "within", + ]), + ("2015-09-10T10:20:30Z", true, [ + "within", + ]), + ("2015-09-09T10:20:30Z", true, [ + "within", + ]), + ("2015-09-08T10:20:30Z", true, [ + "within", + ]), + ("2015-09-06T10:20:30Z", true, [ + "within", + ]), + ("2015-09-05T10:20:30Z", true, [ + "within", + ]), + ("2015-09-02T10:20:30Z", true, [ + "within", + ]), + ("2015-09-01T10:20:30Z", true, [ + "within", + ]), + ("2015-08-22T10:20:30Z", true, [ + "within", + ]), + ("2015-08-21T10:20:30Z", true, [ + "within", + ]), + ("2015-08-20T10:20:30Z", true, [ + "within", + ]), + ("2015-08-18T10:20:30Z", true, [ + "within", + ]), + ("2015-08-15T10:20:30Z", true, [ + "within", + ]), + ("2015-08-13T10:20:30Z", true, [ + "within", + ]), + ("2015-08-12T10:20:30Z", true, [ + "within", + ]), + ("2015-08-10T10:20:30Z", true, [ + "within", + ]), + ("2015-08-08T10:20:30Z", true, [ + "within", + ]), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 2months 3days 3h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 2months 3days 3h.snap new file mode 100644 index 00000000..a3f415d7 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within1year 2months 3days 3h.snap @@ -0,0 +1,243 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", true, [ + "within", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within", + ]), + ("2016-01-04T12:30:03Z", true, [ + "within", + ]), + ("2016-01-04T12:28:03Z", true, [ + "within", + ]), + ("2016-01-04T12:24:03Z", true, [ + "within", + ]), + ("2016-01-04T12:23:03Z", true, [ + "within", + ]), + ("2016-01-04T11:23:03Z", true, [ + "within", + ]), + ("2016-01-04T10:23:03Z", true, [ + "within", + ]), + ("2016-01-03T07:02:03Z", true, [ + "within", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within", + ]), + ("2016-01-01T01:03:03Z", true, [ + "within", + ]), + ("2016-01-01T01:02:03Z", true, [ + "within", + ]), + ("2015-11-22T10:20:30Z", true, [ + "within", + ]), + ("2015-11-21T10:20:30Z", true, [ + "within", + ]), + ("2015-11-20T10:20:30Z", true, [ + "within", + ]), + ("2015-11-18T10:20:30Z", true, [ + "within", + ]), + ("2015-11-15T10:20:30Z", true, [ + "within", + ]), + ("2015-11-13T10:20:30Z", true, [ + "within", + ]), + ("2015-11-12T10:20:30Z", true, [ + "within", + ]), + ("2015-11-10T10:20:30Z", true, [ + "within", + ]), + ("2015-11-08T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-22T10:20:30Z", true, [ + "within", + ]), + ("2015-10-20T10:20:30Z", true, [ + "within", + ]), + ("2015-10-11T10:20:30Z", true, [ + "within", + ]), + ("2015-10-10T10:20:30Z", true, [ + "within", + ]), + ("2015-10-09T10:20:30Z", true, [ + "within", + ]), + ("2015-10-08T10:20:30Z", true, [ + "within", + ]), + ("2015-10-06T10:20:30Z", true, [ + "within", + ]), + ("2015-10-05T10:20:30Z", true, [ + "within", + ]), + ("2015-10-02T10:20:30Z", true, [ + "within", + ]), + ("2015-10-01T10:20:30Z", true, [ + "within", + ]), + ("2015-09-22T10:20:30Z", true, [ + "within", + ]), + ("2015-09-20T10:20:30Z", true, [ + "within", + ]), + ("2015-09-11T10:20:30Z", true, [ + "within", + ]), + ("2015-09-10T10:20:30Z", true, [ + "within", + ]), + ("2015-09-09T10:20:30Z", true, [ + "within", + ]), + ("2015-09-08T10:20:30Z", true, [ + "within", + ]), + ("2015-09-06T10:20:30Z", true, [ + "within", + ]), + ("2015-09-05T10:20:30Z", true, [ + "within", + ]), + ("2015-09-02T10:20:30Z", true, [ + "within", + ]), + ("2015-09-01T10:20:30Z", true, [ + "within", + ]), + ("2015-08-22T10:20:30Z", true, [ + "within", + ]), + ("2015-08-21T10:20:30Z", true, [ + "within", + ]), + ("2015-08-20T10:20:30Z", true, [ + "within", + ]), + ("2015-08-18T10:20:30Z", true, [ + "within", + ]), + ("2015-08-15T10:20:30Z", true, [ + "within", + ]), + ("2015-08-13T10:20:30Z", true, [ + "within", + ]), + ("2015-08-12T10:20:30Z", true, [ + "within", + ]), + ("2015-08-10T10:20:30Z", true, [ + "within", + ]), + ("2015-08-08T10:20:30Z", true, [ + "within", + ]), + ("2014-11-22T10:20:30Z", true, [ + "within", + ]), + ("2014-11-21T10:20:30Z", true, [ + "within", + ]), + ("2014-11-20T10:20:30Z", true, [ + "within", + ]), + ("2014-11-18T10:20:30Z", true, [ + "within", + ]), + ("2014-11-15T10:20:30Z", true, [ + "within", + ]), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2days.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2days.snap new file mode 100644 index 00000000..f8c71eda --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2days.snap @@ -0,0 +1,115 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2months 2h.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2months 2h.snap new file mode 100644 index 00000000..06dd5415 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within2months 2h.snap @@ -0,0 +1,157 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", true, [ + "within", + ]), + ("2016-01-08T20:02:03Z", true, [ + "within", + ]), + ("2016-01-07T10:02:03Z", true, [ + "within", + ]), + ("2016-01-06T08:02:03Z", true, [ + "within", + ]), + ("2016-01-05T09:02:03Z", true, [ + "within", + ]), + ("2016-01-04T16:23:03Z", true, [ + "within", + ]), + ("2016-01-04T12:30:03Z", true, [ + "within", + ]), + ("2016-01-04T12:28:03Z", true, [ + "within", + ]), + ("2016-01-04T12:24:03Z", true, [ + "within", + ]), + ("2016-01-04T12:23:03Z", true, [ + "within", + ]), + ("2016-01-04T11:23:03Z", true, [ + "within", + ]), + ("2016-01-04T10:23:03Z", true, [ + "within", + ]), + ("2016-01-03T07:02:03Z", true, [ + "within", + ]), + ("2016-01-01T07:08:03Z", true, [ + "within", + ]), + ("2016-01-01T01:03:03Z", true, [ + "within", + ]), + ("2016-01-01T01:02:03Z", true, [ + "within", + ]), + ("2015-11-22T10:20:30Z", true, [ + "within", + ]), + ("2015-11-21T10:20:30Z", true, [ + "within", + ]), + ("2015-11-20T10:20:30Z", true, [ + "within", + ]), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within7days.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within7days.snap new file mode 100644 index 00000000..50e7ee42 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-within7days.snap @@ -0,0 +1,119 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "within", + ]), + ("2016-01-12T21:08:03Z", true, [ + "within", + ]), + ("2016-01-12T21:02:03Z", true, [ + "within", + ]), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", false, []), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", false, []), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", false, []), +]) diff --git a/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-yearly10.snap b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-yearly10.snap new file mode 100644 index 00000000..4b83b376 --- /dev/null +++ b/crates/core/src/commands/snapshots/rustic_core__commands__forget__tests__keep-yearly10.snap @@ -0,0 +1,121 @@ +--- +source: crates/core/src/commands/forget.rs +expression: result +--- +ForgetResult([ + ("2016-01-18T12:02:03Z", true, [ + "yearly", + ]), + ("2016-01-12T21:08:03Z", false, []), + ("2016-01-12T21:02:03Z", false, []), + ("2016-01-09T21:02:03Z", false, []), + ("2016-01-08T20:02:03Z", false, []), + ("2016-01-07T10:02:03Z", false, []), + ("2016-01-06T08:02:03Z", false, []), + ("2016-01-05T09:02:03Z", false, []), + ("2016-01-04T16:23:03Z", false, []), + ("2016-01-04T12:30:03Z", false, []), + ("2016-01-04T12:28:03Z", false, []), + ("2016-01-04T12:24:03Z", false, []), + ("2016-01-04T12:23:03Z", false, []), + ("2016-01-04T11:23:03Z", false, []), + ("2016-01-04T10:23:03Z", false, []), + ("2016-01-03T07:02:03Z", false, []), + ("2016-01-01T07:08:03Z", false, []), + ("2016-01-01T01:03:03Z", false, []), + ("2016-01-01T01:02:03Z", false, []), + ("2015-11-22T10:20:30Z", true, [ + "yearly", + ]), + ("2015-11-21T10:20:30Z", false, []), + ("2015-11-20T10:20:30Z", false, []), + ("2015-11-18T10:20:30Z", false, []), + ("2015-11-15T10:20:30Z", false, []), + ("2015-11-13T10:20:30Z", false, []), + ("2015-11-12T10:20:30Z", false, []), + ("2015-11-10T10:20:30Z", false, []), + ("2015-11-08T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-22T10:20:30Z", false, []), + ("2015-10-20T10:20:30Z", false, []), + ("2015-10-11T10:20:30Z", false, []), + ("2015-10-10T10:20:30Z", false, []), + ("2015-10-09T10:20:30Z", false, []), + ("2015-10-08T10:20:30Z", false, []), + ("2015-10-06T10:20:30Z", false, []), + ("2015-10-05T10:20:30Z", false, []), + ("2015-10-02T10:20:30Z", false, []), + ("2015-10-01T10:20:30Z", false, []), + ("2015-09-22T10:20:30Z", false, []), + ("2015-09-20T10:20:30Z", false, []), + ("2015-09-11T10:20:30Z", false, []), + ("2015-09-10T10:20:30Z", false, []), + ("2015-09-09T10:20:30Z", false, []), + ("2015-09-08T10:20:30Z", false, []), + ("2015-09-06T10:20:30Z", false, []), + ("2015-09-05T10:20:30Z", false, []), + ("2015-09-02T10:20:30Z", false, []), + ("2015-09-01T10:20:30Z", false, []), + ("2015-08-22T10:20:30Z", false, []), + ("2015-08-21T10:20:30Z", false, []), + ("2015-08-20T10:20:30Z", false, []), + ("2015-08-18T10:20:30Z", false, []), + ("2015-08-15T10:20:30Z", false, []), + ("2015-08-13T10:20:30Z", false, []), + ("2015-08-12T10:20:30Z", false, []), + ("2015-08-10T10:20:30Z", false, []), + ("2015-08-08T10:20:30Z", false, []), + ("2014-11-22T10:20:30Z", true, [ + "yearly", + ]), + ("2014-11-21T10:20:30Z", false, []), + ("2014-11-20T10:20:30Z", false, []), + ("2014-11-18T10:20:30Z", false, []), + ("2014-11-15T10:20:30Z", false, []), + ("2014-11-13T10:20:30Z", false, []), + ("2014-11-12T10:20:30Z", false, []), + ("2014-11-10T10:20:30Z", false, []), + ("2014-11-08T10:20:30Z", false, []), + ("2014-10-22T10:20:30Z", false, []), + ("2014-10-20T10:20:30Z", false, []), + ("2014-10-11T10:20:30Z", false, []), + ("2014-10-10T10:20:30Z", false, []), + ("2014-10-09T10:20:30Z", false, []), + ("2014-10-08T10:20:30Z", false, []), + ("2014-10-06T10:20:30Z", false, []), + ("2014-10-05T10:20:30Z", false, []), + ("2014-10-02T10:20:30Z", false, []), + ("2014-10-01T10:20:30Z", false, []), + ("2014-09-22T10:20:30Z", false, []), + ("2014-09-20T10:20:30Z", false, []), + ("2014-09-11T10:20:30Z", false, []), + ("2014-09-10T10:20:30Z", false, []), + ("2014-09-09T10:20:30Z", false, []), + ("2014-09-08T10:20:30Z", false, []), + ("2014-09-06T10:20:30Z", false, []), + ("2014-09-05T10:20:30Z", false, []), + ("2014-09-02T10:20:30Z", false, []), + ("2014-09-01T10:29:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:28:37Z", false, [ + "snapshot", + ]), + ("2014-09-01T10:25:37Z", true, [ + "snapshot", + ]), + ("2014-09-01T10:20:30Z", false, []), + ("2014-08-22T10:20:30Z", false, []), + ("2014-08-21T10:20:30Z", false, []), + ("2014-08-20T10:20:30Z", false, []), + ("2014-08-18T10:20:30Z", false, []), + ("2014-08-15T10:20:30Z", false, []), + ("2014-08-13T10:20:30Z", false, []), + ("2014-08-12T10:20:30Z", false, []), + ("2014-08-10T10:20:30Z", false, []), + ("2014-08-08T10:20:30Z", true, [ + "yearly", + ]), +]) diff --git a/crates/core/src/error.rs b/crates/core/src/error.rs index 57ecda26..b268d26b 100644 --- a/crates/core/src/error.rs +++ b/crates/core/src/error.rs @@ -218,6 +218,8 @@ pub enum CommandErrorKind { ConversionFromIntFailed(TryFromIntError), /// {0} is not allowed on an append-only repository NotAllowedWithAppendOnly(String), + /// Specify one of the keep-* options for forget! Please use keep-none to keep no snapshot. + NoKeepOption, } /// [`CryptoErrorKind`] describes the errors that can happen while dealing with Cryptographic functions diff --git a/crates/core/src/repository.rs b/crates/core/src/repository.rs index 56f2ef57..ecea91be 100644 --- a/crates/core/src/repository.rs +++ b/crates/core/src/repository.rs @@ -987,7 +987,7 @@ impl Repository { /// /// # Errors /// - // TODO: Document errors + /// If keep options are not valid /// /// # Returns ///