mirror of
https://github.com/starship/starship.git
synced 2025-01-05 14:09:06 +01:00
test for deserialization from string
This commit is contained in:
parent
82b5b6ea1b
commit
c1a0cefc30
@ -133,6 +133,24 @@ mod tests {
|
|||||||
assert!(style.should_apply(&context));
|
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]
|
#[test]
|
||||||
fn should_deserialize_from_table_value() {
|
fn should_deserialize_from_table_value() {
|
||||||
let config = toml::toml! {
|
let config = toml::toml! {
|
||||||
|
Loading…
Reference in New Issue
Block a user