From 75feef62cb45017e63f34719cb45b5aac504f561 Mon Sep 17 00:00:00 2001 From: David Knaack Date: Wed, 15 Sep 2021 17:58:58 +0200 Subject: [PATCH] fix(print-config): add missing `format_right` to `FullConfig` (#3063) --- src/configs/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/configs/mod.rs b/src/configs/mod.rs index 5e844fb3..733c8ae3 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -76,6 +76,7 @@ pub use starship_root::*; pub struct FullConfig<'a> { // Root config pub format: &'a str, + pub right_format: &'a str, pub scan_timeout: u64, pub command_timeout: u64, pub add_newline: bool, @@ -150,6 +151,7 @@ impl<'a> Default for FullConfig<'a> { fn default() -> Self { Self { format: "$all", + right_format: "", scan_timeout: 30, command_timeout: 500, add_newline: true, @@ -236,4 +238,17 @@ mod test { assert!(cfg_table.contains_key(*module)); } } + + #[test] + fn root_in_full_config() { + let full_cfg = Value::try_from(FullConfig::default()).unwrap(); + let cfg_table = full_cfg.as_table().unwrap(); + + let root_cfg = Value::try_from(StarshipRootConfig::default()).unwrap(); + let root_table = root_cfg.as_table().unwrap(); + for (option, default_value) in root_table.iter() { + assert!(cfg_table.contains_key(option)); + assert_eq!(&cfg_table[option], default_value); + } + } }