aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/math/tests.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib/math/tests.clj')
-rw-r--r--src/clojure/contrib/math/tests.clj18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/clojure/contrib/math/tests.clj b/src/clojure/contrib/math/tests.clj
index 62816b3f..0d434007 100644
--- a/src/clojure/contrib/math/tests.clj
+++ b/src/clojure/contrib/math/tests.clj
@@ -3,7 +3,7 @@
clojure.contrib.math))
(deftest test-expt
- (are (= _1 _2)
+ (are [x y] (= x y)
(expt 2 3) 8
(expt (expt 2 32) 2) (expt 2 64)
(expt 4/3 2) 16/9
@@ -13,7 +13,7 @@
(expt 5.3 4) (Math/pow 5.3 4)))
(deftest test-abs
- (are (= _1 _2)
+ (are [x y] (= x y)
(abs -2) 2
(abs 0) 0
(abs 5) 5
@@ -27,7 +27,7 @@
(abs -2.8) 2.8))
(deftest test-gcd
- (are (= _1 _2)
+ (are [x y] (= x y)
(gcd 4 3) 1
(gcd 24 12) 12
(gcd 24 27) 3
@@ -39,7 +39,7 @@
(is (thrown? IllegalArgumentException (gcd 7.0 0))))
(deftest test-lcm
- (are (= _1 _2)
+ (are [x y] (= x y)
(lcm 2 3) 6
(lcm 3 2) 6
(lcm -2 3) 6
@@ -54,7 +54,7 @@
(is (thrown? IllegalArgumentException (lcm 7.0 0))))
(deftest test-floor
- (are (= _1 _2)
+ (are [x y] (= x y)
(floor 6) 6
(floor -6) -6
(floor 123456789123456789) 123456789123456789
@@ -67,7 +67,7 @@
(floor -4.3) -5.0))
(deftest test-ceil
- (are (= _1 _2)
+ (are [x y] (= x y)
(ceil 6) 6
(ceil -6) -6
(ceil 123456789123456789) 123456789123456789
@@ -80,7 +80,7 @@
(ceil -4.3) -4.0))
(deftest test-round
- (are (= _1 _2)
+ (are [x y] (= x y)
(round 6) 6
(round -6) -6
(round 123456789123456789) 123456789123456789
@@ -105,14 +105,14 @@
(round -4.5) -4))
(deftest test-sqrt
- (are (= _1 _2)
+ (are [x y] (= x y)
(sqrt 9) 3
(sqrt 16/9) 4/3
(sqrt 0.25M) 0.5M
(sqrt 2) (Math/sqrt 2)))
(deftest test-exact-integer-sqrt
- (are (= _1 _2)
+ (are [x y] (= x y)
(exact-integer-sqrt 15) [3 6]
(exact-integer-sqrt (inc (expt 2 64))) [(expt 2 32) 1]
(exact-integer-sqrt 1000000000000) [1000000 0]))