Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…o in-place fn
  • Loading branch information...
commit f068c6ec5da7b2f5e7b542deb7cbaef976ac2286 1 parent 6e8de73
Fogus authored January 15, 2013
10  src/test/clojure/clojure/core/contracts_tests.clj
@@ -71,5 +71,15 @@
71 71
     (is (= -10 ((partial doubler-contract-no-requires #(* 2 %)) -5)))
72 72
     (is (thrown? Error ((partial doubler-contract-no-requires #(* 3 %)) 5)))))
73 73
 
  74
+(deftest test-partial-contract-no-requires-and-isolated-fn
  75
+  (let [doubler-contract-no-requires-and-isolated-fn
  76
+        (contract doubler
  77
+          "Test"
  78
+          [x] [=> pos? (= (* 2 x) %)])]
  79
+
  80
+    (is (= 10 ((partial doubler-contract-no-requires-and-isolated-fn #(* 2 %)) 5)))
  81
+    (is (thrown? Error ((partial doubler-contract-no-requires-and-isolated-fn #(* 2 %)) -5)))
  82
+    (is (thrown? Error ((partial doubler-contract-no-requires-and-isolated-fn #(* 3 %)) 5)))))
  83
+
74 84
 (deftest test-regressions
75 85
   (defer "regression testing"))

0 notes on commit f068c6e

Please sign in to comment.
Something went wrong with that request. Please try again.