diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-06-15 10:59:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 08:59:12 +0000 |
commit | afffdbe612cb8b573016184400e0deeb0137ccb9 (patch) | |
tree | 3f79b638ec3e5c8f85f2ba784898ee1fa9034322 /alacritty_config_derive/tests | |
parent | be03effdbe5b5bdabfed50d87963e78017329182 (diff) | |
download | alacritty-afffdbe612cb8b573016184400e0deeb0137ccb9.tar.gz alacritty-afffdbe612cb8b573016184400e0deeb0137ccb9.zip |
Fix `alacritty msg config` toml replacement
This fixes a regression introduced in bd49067 which broke the override
of configuration file variables using `alacritty msg config`.
To fix this the `replace` functionality was rewritten to behave more
like the `serde_utils::merge` where entire values are inserted into the
existing structure rather than separating the keys from the values.
Fixes: bd49067 (Switch to TOML configuration format)
Diffstat (limited to 'alacritty_config_derive/tests')
-rw-r--r-- | alacritty_config_derive/tests/config.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/alacritty_config_derive/tests/config.rs b/alacritty_config_derive/tests/config.rs index 15bc62a9..3130bcda 100644 --- a/alacritty_config_derive/tests/config.rs +++ b/alacritty_config_derive/tests/config.rs @@ -173,8 +173,8 @@ impl Log for Logger { fn field_replacement() { let mut test = Test::default(); - let value = toml::Value::Integer(13); - test.replace("nesting.field2", value).unwrap(); + let value = toml::from_str("nesting.field2=13").unwrap(); + test.replace(value).unwrap(); assert_eq!(test.nesting.field2, Some(13)); } @@ -183,8 +183,8 @@ fn field_replacement() { fn replace_derive() { let mut test = Test::default(); - let value = toml::Value::Integer(9); - test.replace("nesting.newtype", value).unwrap(); + let value = toml::from_str("nesting.newtype=9").unwrap(); + test.replace(value).unwrap(); assert_eq!(test.nesting.newtype, NewType(9)); } @@ -193,8 +193,8 @@ fn replace_derive() { fn replace_flatten() { let mut test = Test::default(); - let value = toml::Value::Integer(7); - test.replace("flatty", value).unwrap(); + let value = toml::from_str("flatty=7").unwrap(); + test.replace(value).unwrap(); assert_eq!(test.flatten.flatty, 7); } |