mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Error on negative argument of first
(#7186)
Fixes a two's complement underflow/overflow when given a negative arg. Breaking change as it is throwing an error instead of most likely returning most of the output. Same behavior as #7184 # Tests + Formatting + 1 failure test # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
committed by
GitHub
parent
ce03d8eb12
commit
cf96677c78
@ -92,3 +92,16 @@ fn works_with_binary_list() {
|
||||
|
||||
assert_eq!(actual.out, "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn errors_on_negative_rows() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
[1, 2, 3]
|
||||
| first -10
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("use a positive value"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user