mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Implement support for bare vars by math
This change allows you to type `math x + 3` rather than `math $x + 3`. Another step to resolving issue #3157.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
|
||||
####################
|
||||
# Validate basic expressions
|
||||
|
||||
####################
|
||||
# Validate how bare variables in an epxression are handled
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
logmsg Validate basic expressions
|
||||
math 3 / 2
|
||||
math 10/6
|
||||
math -s0 10 / 6
|
||||
@@ -12,3 +13,12 @@ math '-2 * -2'
|
||||
math 5 \* -2
|
||||
math -- -4 / 2
|
||||
math -- '-4 * 2'
|
||||
|
||||
logmsg Validate how bare variables in an epxression are handled
|
||||
math x + 1
|
||||
set x 1
|
||||
math x + 1
|
||||
set x 3
|
||||
set y 1.5
|
||||
math '-x * y'
|
||||
math -s1 '-x * y'
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
####################
|
||||
# Validate basic expressions
|
||||
1
|
||||
1
|
||||
1
|
||||
@@ -12,3 +15,10 @@
|
||||
-10
|
||||
-2
|
||||
-8
|
||||
|
||||
####################
|
||||
# Validate how bare variables in an epxression are handled
|
||||
1
|
||||
2
|
||||
-4
|
||||
-4.5
|
||||
|
||||
Reference in New Issue
Block a user