aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/math_spec.moon
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/math_spec.moon')
-rw-r--r--spec/lib/math_spec.moon13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/math_spec.moon b/spec/lib/math_spec.moon
index 40c7abd..038fc5a 100644
--- a/spec/lib/math_spec.moon
+++ b/spec/lib/math_spec.moon
@@ -153,6 +153,19 @@ describe "math", ->
(- [[1 2] [1 2]]
[1 2])'
+ describe "add, sub, mul", ->
+ it "handle single arguments", ->
+ COPILOT\eval_once '
+ (expect= [3 4 5]
+ (+ [3 4 5]))
+
+ (expect= [0 1 -2]
+ (- [0 -1 2]))
+
+ (expect= [1 2 3]
+ (* [1 2 3]))
+ '
+
describe "mul", ->
it "handles scalars and matrices", ->
with COPILOT\eval_once '