use slate_kv::{Db, KeySource, Options, Profile};
use slate_kv_core::epoch::SecurityMode;
#[test]
fn test_security_mode() {
let path = std::path::Path::new("./test_db_sec");
let _ = std::fs::remove_dir_all(path);
std::fs::create_dir_all(path).unwrap();
let opts = Options {
capacity: 4096 * 1024,
b_commit: 9,
auto_b: false,
staleness_budget_ms: 1000,
n_keys: 100,
profile: Profile::Pi,
durability: slate_kv::file_flash::Durability::Full,
};
let db = Db::open(path, KeySource::Bytes([0x42; 32]), opts).unwrap();
assert!(matches!(
db.security_mode(),
SecurityMode::BestEffortRollback
));
}