forked from extern/nushell
### Description Fixes issue #15135 Result  Also this works with other commands: min, max, sum, product, avg... ### User-Facing Changes Error is returned, instead of console completely blocked and having to be killed I chose "Incorrect value", because commands accept inputs of range type, just cannot work with unbounded ranges. ### Tests + Formatting - ran cargo fmt, clippy - added tests
This commit is contained in:
@ -5,3 +5,10 @@ fn const_abs() {
|
||||
let actual = nu!("const ABS = -5.5 | math abs; $ABS");
|
||||
assert_eq!(actual.out, "5.5");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cannot_abs_range() {
|
||||
let actual = nu!("0..5 | math abs");
|
||||
|
||||
assert!(actual.err.contains("nu::parser::input_type_mismatch"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user