add tests for out_greater_pipe

This commit is contained in:
WindSoilder 2024-07-09 06:44:18 +08:00
parent ad6fc9073a
commit 366e3d4103
2 changed files with 9 additions and 1 deletions

View File

@ -653,7 +653,7 @@ fn try_lex_special_piped_item(
return (
None,
Some(ParseError::Expected(
"|, note: redirection stdout to pipe is the same as piping directly.",
"|. Note: redirection stdout to pipe is the same as piping directly.",
Span::new(span_offset + offset, span_offset + offset + o_pipe_len),
)),
);

View File

@ -1161,3 +1161,11 @@ fn command_not_found_error_shows_not_found_2() {
&& actual.err.contains("Did you mean `for`?")
);
}
#[test]
fn error_on_out_greater_pipe() {
let actual = nu!(r#""foo" o>| print"#);
assert!(actual
.err
.contains("redirection stdout to pipe is the same as piping directly"))
}