mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
d1ca392393
It's always a bit annoying that `*` requires quoting. So we allow "x" as an alternative, only it needs to be followed by whitespace to distinguish it from "0x" hexadecimal notation.
43 lines
794 B
Plaintext
43 lines
794 B
Plaintext
|
|
####################
|
|
# Validate basic expressions
|
|
|
|
####################
|
|
# Validate some rounding functions
|
|
|
|
####################
|
|
# Validate some integral computations
|
|
|
|
####################
|
|
# Validate how variables in an expression are handled
|
|
|
|
####################
|
|
# Validate math error reporting
|
|
math: Error: Too few arguments
|
|
'2 - '
|
|
^
|
|
math: Error: Too few arguments
|
|
'ncr(1)'
|
|
^
|
|
math: Error: Expression is bogus
|
|
'max()'
|
|
^
|
|
math: Error: Too few arguments
|
|
'sin()'
|
|
^
|
|
math: Error: Too many arguments
|
|
'2 + 2 4'
|
|
^
|
|
math: Expected at least 1 args, got only 0
|
|
math: Expected at least 1 args, got only 0
|
|
math: Error: Result is infinite
|
|
'2^999999'
|
|
math: Error: Result is infinite
|
|
'1 / 0'
|
|
|
|
####################
|
|
# Validate x as multiplier
|
|
math: Error: Unknown variable
|
|
'2 x4'
|
|
^
|