mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:54:56 +02:00
Switch from serde_yaml to serde_yml (#14630)
# Description This PR fixes #14339. Since [serde_yaml](https://docs.rs/serde_yaml/latest/serde_yaml/) is already deprecated, replaced it with [serde_yml](https://doc.serdeyml.com/serde_yml/). After this change, the `to yaml` boolean parsing issue in #14339 is also fixed. Now the command ``` ['y' 'Y' 'yes' 'Yes' 'YES' 'n' 'N' 'no' 'No' 'No' 'on' 'On' 'ON' 'off' 'Off' 'OFF'] | to yaml ``` will return ``` - 'y' - 'Y' - 'yes' - 'Yes' - 'YES' - 'n' - 'N' - 'no' - 'No' - 'No' - 'on' - 'On' - 'ON' - 'off' - 'Off' - 'OFF' ``` # User-Facing Changes I'm not sure if the yaml spec change is a user-facing change.
This commit is contained in:
@ -48,3 +48,18 @@ fn convert_dict_to_yaml_with_integer_floats_key() {
|
||||
assert!(actual.out.contains("2.11"));
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn convert_bool_to_yaml_in_yaml_spec_1_2() {
|
||||
let actual = nu!(pipeline(
|
||||
r#"
|
||||
[y n no On OFF True true false] | to yaml
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"- 'y'- 'n'- 'no'- 'On'- 'OFF'- 'True'- true- false"
|
||||
);
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
Reference in New Issue
Block a user