1
0
mirror of https://github.com/nushell/nushell.git synced 2025-03-13 15:08:43 +01:00
nushell/crates/nu-command/tests/commands/math
Loïc Riegel b432866dc9
bugfix: math commands now return error with infinite range [] ()
### Description
Fixes issue 

Result

![image](https://github.com/user-attachments/assets/9ff4397f-db79-46df-b1da-2d09f50dd63f)

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
2025-03-11 14:40:26 +01:00
..
abs.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
avg.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
ceil.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
floor.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
log.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
max.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
median.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
min.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
mod.rs Improve and fix filesize formatting/display () 2025-01-22 22:24:51 -08:00
mode.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
product.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
round.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
sqrt.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
stddev.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
sum.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00
variance.rs bugfix: math commands now return error with infinite range [] () 2025-03-11 14:40:26 +01:00