From 0d3f943f307088de1093f3280040e9c41c36691e Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 5 Aug 2023 11:54:39 -0700 Subject: [PATCH] Add some additional tests for builtin math This fills some gaps in our error message test coverage. --- tests/checks/math.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/checks/math.fish b/tests/checks/math.fish index d191971ea..aae949297 100644 --- a/tests/checks/math.fish +++ b/tests/checks/math.fish @@ -161,6 +161,17 @@ not math -s 12 not math 2^999999 # CHECKERR: math: Error: Result is infinite # CHECKERR: '2^999999' +not math 'sqrt(-1)' +# CHECKERR: math: Error: Result is not a number +# CHECKERR: 'sqrt(-1)' +math 'sqrt(-0)' +# CHECK: -0 +not math 2^53 + 1 +# CHECKERR: math: Error: Result magnitude is too large +# CHECKERR: '2^53 + 1' +not math -2^53 - 1 +# CHECKERR: math: Error: Result magnitude is too large +# CHECKERR: '-2^53 - 1' printf '<%s>\n' (not math 1 / 0 2>&1) # CHECK: # CHECK: <'1 / 0'>