nushell/crates/nu-command/tests/commands/platform/char_.rs
Douglas bfe398ca36
Fix char lsep assignment (#15065)
Fix `char eol` issue where there was still a hardcoded `\n` taking
effect on Windows.
2025-02-09 07:19:11 -05:00

23 lines
501 B
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn test_char_list_outputs_table() {
let actual = nu!(pipeline(
r#"
char --list | length
"#
));
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");
}