From eed36947fb1a35cdaf21638fb49ecfc4f40cdfc5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 7 Mar 2021 16:58:03 +0000 Subject: [PATCH 1/2] tests: Add a unit test for zmathfunc and a regression test for workers/48146 affecting it. --- Test/Z02zmathfunc.ztst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Test/Z02zmathfunc.ztst diff --git a/Test/Z02zmathfunc.ztst b/Test/Z02zmathfunc.ztst new file mode 100644 index 000000000..94bc59576 --- /dev/null +++ b/Test/Z02zmathfunc.ztst @@ -0,0 +1,23 @@ +%prep + autoload -Uz zmathfunc && zmathfunc + +%test + + echo $(( min(42, 43) )) $(( max(42, 43) )) $(( sum(42, 43) )) + echo $(( min(42) )) $(( max(42) )) $(( sum(42) )) + echo $(( sum() )) +0:basic functionality test +>42 43 85 +>42 42 42 +>0 + + + (set -e; echo $(( min(0, 42) ))) + (set -e; echo $(( max(0, -42) ))) + (set -e; echo $(( sum(42, -42) ))) +-f:regression test for ERR_EXIT +>0 +>0 +>0 + +%clean