Files
movies-diary/crates/tui/tests/config_test.rs
Gabriel Kaszewski 017b58d6fa
Some checks failed
CI / Check / Test (push) Has been cancelled
code refactor
Reviewed-on: #26
2026-10-26 09:36:23 +00:00

17 lines
421 B
Rust

use tui::config::Config;
#[test]
fn config_survives_json_round_trip() {
let config = Config {
api_url: "http://localhost:3000".into(),
};
let json = serde_json::to_string(&config).unwrap();
let decoded: Config = serde_json::from_str(&json).unwrap();
assert_eq!(decoded.api_url, "http://localhost:3000");
}
#[test]
fn load_without_config_file_does_not_panic() {
let _ = Config::load();
}