diff --git a/crates/nu-command/src/formats/to/nuon.rs b/crates/nu-command/src/formats/to/nuon.rs index 1b4334196f..abe34c0548 100644 --- a/crates/nu-command/src/formats/to/nuon.rs +++ b/crates/nu-command/src/formats/to/nuon.rs @@ -34,7 +34,6 @@ impl Command for ToNuon { call: &Call, input: PipelineData, ) -> Result { - let input = input.try_expand_range()?; Ok(Value::String { val: to_nuon(call, input)?, span: call.head, diff --git a/crates/nu-command/tests/format_conversions/nuon.rs b/crates/nu-command/tests/format_conversions/nuon.rs index 3b6f48f424..1ad03a38fb 100644 --- a/crates/nu-command/tests/format_conversions/nuon.rs +++ b/crates/nu-command/tests/format_conversions/nuon.rs @@ -177,6 +177,33 @@ fn to_nuon_records() { assert_eq!(actual.out, "true"); } +#[test] +fn to_nuon_range() { + let actual = nu!( + cwd: "tests/fixtures/formats", pipeline( + r#" + 1..42 + | to nuon + "# + )); + + assert_eq!(actual.out, "1..42"); +} + +#[test] +fn from_nuon_range() { + let actual = nu!( + cwd: "tests/fixtures/formats", pipeline( + r#" + "1..42" + | from nuon + | describe + "# + )); + + assert_eq!(actual.out, "range"); +} + #[test] fn binary_to() { let actual = nu!(