aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2009-06-24 00:01:11 -0400
committerStuart Halloway <stu@thinkrelevance.com>2009-06-24 00:01:11 -0400
commit0930bfdf3361f76d773149b5bd7170c435fe5f20 (patch)
tree8445bed1696c397a1e56f3e50f8f356ba3869dd6 /src
parent85c4905b3ccb94dfdb2272e92de6ba1051e304e3 (diff)
gtic: updated contrib tests to use new template syntax
Diffstat (limited to 'src')
-rw-r--r--src/clojure/contrib/test_contrib/fnmap.clj6
-rw-r--r--src/clojure/contrib/test_contrib/monads.clj6
-rw-r--r--src/clojure/contrib/test_contrib/pprint/helper.clj2
-rw-r--r--src/clojure/contrib/test_contrib/shell_out.clj10
4 files changed, 12 insertions, 12 deletions
diff --git a/src/clojure/contrib/test_contrib/fnmap.clj b/src/clojure/contrib/test_contrib/fnmap.clj
index ccd7a54a..8d833360 100644
--- a/src/clojure/contrib/test_contrib/fnmap.clj
+++ b/src/clojure/contrib/test_contrib/fnmap.clj
@@ -4,16 +4,16 @@
(deftest acts-like-map
(let [m1 (fnmap get assoc :key1 1 :key2 2)]
- (are (= _2 (get m1 _1))
+ (are [k v] (= v (get m1 k))
:key1 1
:key2 2
:nonexistent-key nil)
- (are (= _2 (_1 m1))
+ (are [k v] (= v (k m1))
:key1 1
:key2 2
:nonexistent-key nil)
(let [m2 (assoc m1 :key3 3 :key4 4)]
- (are (= _2 (get m2 _1))
+ (are [k v] (= v (get m2 k))
:key1 1
:key2 2
:key3 3
diff --git a/src/clojure/contrib/test_contrib/monads.clj b/src/clojure/contrib/test_contrib/monads.clj
index 5d38b544..a09d646d 100644
--- a/src/clojure/contrib/test_contrib/monads.clj
+++ b/src/clojure/contrib/test_contrib/monads.clj
@@ -19,7 +19,7 @@
(deftest sequence-monad
(with-monad sequence-m
- (are (= _1 _2)
+ (are [a b] (= a b)
(domonad [x (range 3) y (range 2)] (+ x y))
'(0 1 1 2 2 3)
(domonad [x (range 5) y (range (+ 1 x)) :when (= (+ x y) 2)] (list x y))
@@ -37,7 +37,7 @@
(with-monad maybe-m
(let [m+ (m-lift 2 +)
mdiv (fn [x y] (domonad [a x b y :when (not (zero? b))] (/ a b)))]
- (are (= _1 _2)
+ (are [a b] (= a b)
(m+ (m-result 1) (m-result 3))
(m-result 4)
(mdiv (m-result 1) (m-result 3))
@@ -50,7 +50,7 @@
(deftest seq-maybe-monad
(with-monad (maybe-t sequence-m)
(letfn [(pairs [xs] ((m-lift 2 #(list %1 %2)) xs xs))]
- (are (= _1 _2)
+ (are [a b] (= a b)
((m-lift 1 inc) (for [n (range 10)] (when (odd? n) n)))
'(nil 2 nil 4 nil 6 nil 8 nil 10)
(pairs (for [n (range 5)] (when (odd? n) n)))
diff --git a/src/clojure/contrib/test_contrib/pprint/helper.clj b/src/clojure/contrib/test_contrib/pprint/helper.clj
index c7112e68..9a4005d6 100644
--- a/src/clojure/contrib/test_contrib/pprint/helper.clj
+++ b/src/clojure/contrib/test_contrib/pprint/helper.clj
@@ -17,5 +17,5 @@
(:use [clojure.contrib.test-is :only (deftest are run-tests)]))
(defmacro simple-tests [name & test-pairs]
- `(deftest ~name (are (= _1 _2) ~@test-pairs)))
+ `(deftest ~name (are [x y] (= x y) ~@test-pairs)))
diff --git a/src/clojure/contrib/test_contrib/shell_out.clj b/src/clojure/contrib/test_contrib/shell_out.clj
index 0bd1afbe..b6cedabb 100644
--- a/src/clojure/contrib/test_contrib/shell_out.clj
+++ b/src/clojure/contrib/test_contrib/shell_out.clj
@@ -9,7 +9,7 @@
(def as-env-string ((ns-interns 'clojure.contrib.shell-out) 'as-env-string))
(deftest test-parse-args
- (are (= _1 _2)
+ (are [x y] (= x y)
{:cmd [nil] :out "UTF-8" :dir nil :env nil} (parse-args [])
{:cmd ["ls"] :out "UTF-8" :dir nil :env nil} (parse-args ["ls"])
{:cmd ["ls" "-l"] :out "UTF-8" :dir nil :env nil} (parse-args ["ls" "-l"])
@@ -17,17 +17,17 @@
))
(deftest test-with-sh-dir
- (are (= _1 _2)
+ (are [x y] (= x y)
nil *sh-dir*
"foo" (with-sh-dir "foo" *sh-dir*)))
(deftest test-with-sh-env
- (are (= _1 _2)
+ (are [x y] (= x y)
nil *sh-env*
{:KEY "VAL"} (with-sh-env {:KEY "VAL"} *sh-env*)))
(deftest test-as-env-string
- (are (= _1 _2)
+ (are [x y] (= x y)
nil (as-env-string nil)
["FOO=BAR"] (seq (as-env-string {"FOO" "BAR"}))
["FOO_SYMBOL=BAR"] (seq (as-env-string {'FOO_SYMBOL "BAR"}))
@@ -35,7 +35,7 @@
(deftest test-as-file
- (are (= _1 _2)
+ (are [x y] (= x y)
(File. "foo") (as-file "foo")
nil (as-file nil)
(File. "bar") (as-file (File. "bar")))) \ No newline at end of file