From 71e1d18ceae58eb91385187a6bdccdde31754ba8 Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Sun, 14 Apr 2024 23:38:17 +0100 Subject: [PATCH] test: increase coverage tests in `src/config.rs` (#61) --- src/config.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/config.rs b/src/config.rs index 232bb71..5276938 100644 --- a/src/config.rs +++ b/src/config.rs @@ -52,6 +52,15 @@ impl Default for &Core { } } +impl Default for Core { + fn default() -> Self { + Core { + buffer_size: 64, + auto_commit: false, + } + } +} + impl Default for Theme { fn default() -> Self { let font = ThemeFont { @@ -93,6 +102,11 @@ mod tests { let config = Config::from_file(Path::new("./data/sample.toml")); assert!(config.is_ok()); + // Load default core and theme. + let config = config.unwrap(); + config.core.unwrap_or_default(); + config.theme.unwrap_or_default(); + let config = Config::from_file(Path::new("./data/full_sample.toml")); assert!(config.is_ok());