From 0db506921c69a403da8f2186fe3931ec29e22817 Mon Sep 17 00:00:00 2001 From: RikukiIX Date: Fri, 20 Dec 2024 16:23:59 +0800 Subject: [PATCH] test: test on 'to yaml' boolean parsing in spec 1.2 --- .../nu-command/tests/format_conversions/yaml.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/nu-command/tests/format_conversions/yaml.rs b/crates/nu-command/tests/format_conversions/yaml.rs index 57e75164ab..146890012e 100644 --- a/crates/nu-command/tests/format_conversions/yaml.rs +++ b/crates/nu-command/tests/format_conversions/yaml.rs @@ -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()); +}