use ralph::config::{Config, SessionConfig};
use ralph::session::Session;
use tempfile::TempDir;
fn test_config(sessions_dir: &str) -> Config {
let mut config = Config::default();
config.session = SessionConfig {
auto_resume: false,
sessions_dir: Some(sessions_dir.to_string()),
clean_after_days: 30,
};
config
}
#[test]
fn log_event_does_not_panic() {
let dir = TempDir::new().unwrap();
let workspace = dir.path().join("ws");
std::fs::create_dir_all(&workspace).unwrap();
let sessions_dir = dir.path().join("sessions");
let config = test_config(&sessions_dir.display().to_string());
let session = Session::create(&workspace, "anthropic", "claude-sonnet-4-6", &config).unwrap();
session.log_event("test event 1");
session.log_event("test event 2");
session.log_event("test event 3");
}