16 lines
440 B
Clojure
16 lines
440 B
Clojure
(ns vibe.math.core-test
|
|
(:require [clojure.test :refer [deftest is testing]]
|
|
[vibe.math.core :as math]))
|
|
|
|
(deftest add-test
|
|
(testing "integers"
|
|
(is (= 5 (math/add 2 3)))
|
|
(is (= 0 (math/add 0 0))))
|
|
(testing "negatives"
|
|
(is (= -1 (math/add 2 -3)))
|
|
(is (= -5 (math/add -2 -3))))
|
|
(testing "decimals"
|
|
(is (= 3.5 (math/add 1.5 2))))
|
|
(testing "is commutative"
|
|
(is (= (math/add 4 7) (math/add 7 4)))))
|