Skip to content

Commit

Permalink
test: increase coverage tests in src/config.rs (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad authored Apr 14, 2024
1 parent 311c878 commit 71e1d18
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 71e1d18

Please sign in to comment.