mod cachier;
#[cfg(test)]
mod tests {
use serde_json::json;
use super::*;
#[tokio::test]
async fn test_set_and_get() {
let cache = cachier::Cachier::new("https://example.com/api".to_string(), "memory".to_string());
let is_saved = cache.set("key", json!("value"), Some(3600)).await;
assert!(is_saved);
let result = cache.get(Some("key")).await.unwrap();
assert_eq!(result, "value");
let result = cache.get(Some("invalid_key")).await.unwrap();
assert_eq!(result, "none");
}
}