Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 6e8de733d1440dee3aa4103e950ccf7fc579c31d 1 parent c3ec3f5
@fogus fogus authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/test/clojure/clojure/core/contracts_tests.clj
View
8 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"))
Please sign in to comment.
Something went wrong with that request. Please try again.