40 lines
661 B
Text
40 lines
661 B
Text
(namespace tests.math
|
|
(test.case "math.add"
|
|
(assert.eq! (+ 1 2) 3)
|
|
(assert.eq! (+ 0 0) 0)
|
|
)
|
|
|
|
(test.case "math.sub"
|
|
(assert.eq! (- 5 3) 2)
|
|
(assert.eq! (- 1 1) 0)
|
|
)
|
|
|
|
(test.case "math.mul"
|
|
(assert.eq! (* 3 4) 12)
|
|
(assert.eq! (* 0 5) 0)
|
|
)
|
|
|
|
(test.case "math.div"
|
|
(assert.eq! (/ 10 2) 5)
|
|
)
|
|
|
|
(test.case "math.mod"
|
|
(assert.eq! (% 10 3) 1)
|
|
(assert.eq! (% 5 5) 0)
|
|
)
|
|
|
|
(test.case "math.pow"
|
|
(assert.eq! (** 2 3) 8)
|
|
(assert.eq! (** 5 2) 25)
|
|
)
|
|
|
|
(test.case "math.++"
|
|
(assert.eq! (++ 5) 6)
|
|
(assert.eq! (++ 0) 1)
|
|
)
|
|
|
|
(test.case "math.--"
|
|
(assert.eq! (-- 5) 4)
|
|
(assert.eq! (-- 0) -1)
|
|
)
|
|
)
|