diff --git a/crates/nu-command/src/strings/char_.rs b/crates/nu-command/src/strings/char_.rs index b14ebd7b4f..6a0fe3d57a 100644 --- a/crates/nu-command/src/strings/char_.rs +++ b/crates/nu-command/src/strings/char_.rs @@ -69,7 +69,6 @@ static CHAR_MAP: LazyLock> = LazyLock::new(|| { "eol" => LINE_SEPARATOR_CHAR.to_string(), "lsep" => LINE_SEPARATOR_CHAR.to_string(), "line_sep" => LINE_SEPARATOR_CHAR.to_string(), - "lsep" => '\n'.to_string(), "esep" => ENV_PATH_SEPARATOR_CHAR.to_string(), "env_sep" => ENV_PATH_SEPARATOR_CHAR.to_string(), "tilde" => '~'.to_string(), // ~ diff --git a/crates/nu-command/tests/commands/platform/char_.rs b/crates/nu-command/tests/commands/platform/char_.rs index eeaffd4e4a..b51a6b06d5 100644 --- a/crates/nu-command/tests/commands/platform/char_.rs +++ b/crates/nu-command/tests/commands/platform/char_.rs @@ -10,3 +10,13 @@ fn test_char_list_outputs_table() { assert_eq!(actual.out, "113"); } + +#[test] +fn test_char_eol() { + let actual = nu!(r#" + let expected = if ($nu.os-info.name == 'windows') { "\r\n" } else { "\n" } + ((char lsep) == $expected) and ((char line_sep) == $expected) and ((char eol) == $expected) + "#); + + assert_eq!(actual.out, "true"); +}