From eaa3f0486cffee0485346dc40d17fd43d6490e6a Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 20 Aug 2023 11:19:52 +0200 Subject: [PATCH] math: Add tests for args via stdin and argv This reads stdin and ignores argv, which is certainly a choice. Leaving it this way for now, and possibly discussing later. --- tests/checks/math.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/checks/math.fish b/tests/checks/math.fish index aae949297..5df0daf89 100644 --- a/tests/checks/math.fish +++ b/tests/checks/math.fish @@ -349,3 +349,12 @@ math -0x8p-0_3 echo 5 + 6 | math # CHECK: 11 + +# Historical: If we have arguments on stdin and argv, +# the former takes precedence and the latter is ignored entirely. +echo 7 + 6 | math 2 + 2 +# CHECK: 13 + +# It isn't checked at all. +echo 7 + 8 | math not an expression +# CHECK: 15