use super::*;
#[test]
fn combined_budget_reserves_the_full_action_store_allowance() {
let retention = RetentionSettings {
target_max_bytes: Some(80),
target_max_age: None,
incremental_max_bytes: Some(20),
incremental_max_age: None,
max_total_bytes: Some(100),
};
assert_eq!(target_budget(&retention, 70, 10), Some(20));
assert_eq!(target_budget(&retention, 120, 10), Some(0));
assert_eq!(incremental_budget(&retention, 70), Some(20));
assert_eq!(incremental_budget(&retention, 90), Some(10));
assert_eq!(incremental_budget(&retention, 120), Some(0));
assert_eq!(store_budget(&retention, 70, 30), 70);
assert_eq!(store_budget(&retention, 70, 60), 40);
}