diff --git a/config.toml b/config.toml index f156df2..442e8eb 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ [position] -airfield = "EDRK" +# airfield = "EDRK" [clouds] cloud_minimum = 6 diff --git a/src/config.rs b/src/config.rs index 91c0ba8..b5bd45d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,6 +21,7 @@ use crate::{ Args, Secrets, }; +#[derive(PartialEq, Debug)] pub struct Config { pub position: Position, pub cloud_minimum: i64, @@ -185,3 +186,15 @@ fn read_config_file(config_filepath: Option) -> Config { config } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_read_config_file() { + let expected = Config::default(); + let actual = read_config_file(Some("./config.toml".to_string())); + assert_eq!(expected, actual); + } +} diff --git a/src/position.rs b/src/position.rs index 0a28979..ad15dfc 100644 --- a/src/position.rs +++ b/src/position.rs @@ -13,7 +13,7 @@ use serde_json::Value; use std::fmt::Display; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum Position { Airfield(String), GeoIP, @@ -33,7 +33,7 @@ impl Position { } } -#[derive(Debug, Clone)] +#[derive(Debug, PartialEq, Clone)] pub struct LatLong(pub f64, pub f64); impl Display for LatLong {