diff options
Diffstat (limited to 'tests/db.rs')
| -rw-r--r-- | tests/db.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/db.rs b/tests/db.rs index 75977d1..d750b5a 100644 --- a/tests/db.rs +++ b/tests/db.rs @@ -237,3 +237,16 @@ fn i1_query_flags_index_entries_without_approval() { ); assert_eq!(db::unapproved_index_entries(&env.db).unwrap(), vec!["foo".to_string()]); } + +#[test] +fn a_setting_that_is_absent_is_the_default_and_one_that_is_nonsense_falls_back() { + // m-9: the policy is now stated — absent means default, nonsense means + // default *and a complaint*, because a typo in a knob that silently does + // nothing is worse than a knob that refuses to apply. + let env = Env::new(); + assert_eq!(db::setting_i64(&env.db, "stage_b_cooldown", 86400), 86400); + db::set_setting(&env.db.writer, "stage_b_cooldown", "86400x").unwrap(); + assert_eq!(db::setting_i64(&env.db, "stage_b_cooldown", 86400), 86400); + db::set_setting(&env.db.writer, "stage_b_cooldown", "3600").unwrap(); + assert_eq!(db::setting_i64(&env.db, "stage_b_cooldown", 86400), 3600); +} |
