diff --git a/src/conditional_style.rs b/src/conditional_style.rs index 279560b48..893a04734 100644 --- a/src/conditional_style.rs +++ b/src/conditional_style.rs @@ -133,6 +133,24 @@ mod tests { assert!(style.should_apply(&context)); } + #[test] + fn should_deserialize_from_string_value() { + let config = toml::value::Value::String(String::from("bold red dimmed")); + let deserializer = ValueDeserializer::new(&config); + + let result = StarshipConditionalStyle::deserialize(deserializer); + + assert_eq!( + result, + Ok(StarshipConditionalStyle { + env: None, + operator: None, + expected_value: None, + style: "bold dimmed red" + }) + ); + } + #[test] fn should_deserialize_from_table_value() { let config = toml::toml! {