mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
Handle mixed LF+CRLF in lines
(#7316)
This closes #4989. Previously `lines` was unable to handle text input with CRLF line breaks _and_ LF line breaks. ### Before:  ### After: 
This commit is contained in:
@ -48,3 +48,16 @@ fn lines_multi_value_split() {
|
||||
|
||||
assert_eq!(actual.out, "6");
|
||||
}
|
||||
|
||||
/// test whether this handles CRLF and LF in the same input
|
||||
#[test]
|
||||
fn lines_mixed_line_endings() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
"foo\nbar\r\nquux" | lines | length
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "3");
|
||||
}
|
||||
|
Reference in New Issue
Block a user