Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Proposed contracts behavior/syntax

  • Loading branch information...
commit 54eef53656f3b25cd9d8b678d780623bb89453de 1 parent 4100e99
@abedra abedra authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/main/clojure/clojure/test/generative.clj
View
11 src/main/clojure/clojure/test/generative.clj
@@ -389,7 +389,16 @@ one of the built-in generators:
bindings to the vars in argspecs, plus a binding of '%' to the
result of calling fn-to-test.
- Multiple arities in argspecs are not supported."
+ Multiple arities in argspecs are not supported.
+
+ If contracts are provided (from core.contracts), they will be
+ applied to fn-to-test before the execution of the test.
+
+ (defspec score-invariants
+ score
+ [^{:tag `random-secret} secret
+ ^{:tag `random-secret} guess]
+ score-contract)"
[name fn-to-test args & validator-body]
(when-let [missing-tags (->> (map #(list % (-> % meta :tag)) args)
(filter (fn [[_ tag]] (nil? tag)))
Please sign in to comment.
Something went wrong with that request. Please try again.