Permalink
Browse files

Added in-place fn test of partial contract with no requires

  • Loading branch information...
fogus committed Jan 15, 2013
1 parent c3ec3f5 commit 6e8de733d1440dee3aa4103e950ccf7fc579c31d
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/test/clojure/clojure/core/contracts_tests.clj
@@ -61,7 +61,15 @@
(is (thrown? Error ((partial doubler-contract-arity1-and-isolated-fn #(* 3 %)) 5)))
(is (thrown? Error ((partial doubler-contract-arity1-and-isolated-fn #(* 2 %)) -5)))))
+(deftest test-partial-contract-no-requires
+ (let [doubler-contract-no-requires
+ (contract doubler
+ "Test"
+ [x] [=> (= (* 2 x) %)])]
+ (is (= 10 ((partial doubler-contract-no-requires #(* 2 %)) 5)))
+ (is (= -10 ((partial doubler-contract-no-requires #(* 2 %)) -5)))
+ (is (thrown? Error ((partial doubler-contract-no-requires #(* 3 %)) 5)))))
(deftest test-regressions
(defer "regression testing"))

0 comments on commit 6e8de73

Please sign in to comment.