Meikel  Brandmeyer avatar Meikel Brandmeyer committed 9601dc2

Fix :added tags

Comments (0)

Files changed (1)

src/main/clojure/clojurecheck/core.clj

 (defn int
   "Generates a random integral number between lower and upper.
   The interval is limited by the size guidance."
-  {:added "1.0"}
+  {:added "2.0"}
   [& {:keys [lower upper] :or {lower -32768 upper 32767}}]
   (fn [size]
     (gen-number rand-int lower upper size)))
 (defn float
   "Generates a random floating point number between lower and upper.
   The interval is limited by the size guidance."
-  {:added "1.0"}
+  {:added "2.0"}
   [& {:keys [lower upper] :or {lower -32768.0 upper 32767.0}}]
   (fn [size]
     (gen-number rand lower upper size)))
 
 (def ^{:doc "Generates a random boolean value. Ignores the size guidance"
-       :added "1.0"}
+       :added "2.0"}
   bool
   (fn [size]
     (< (rand) 0.5)))
   "Chooses one of the given generators based on the associated
   weights. The size guidance is passed verbatim to the chosen
   generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [choices]
   (let [freqs   (reductions + (vals choices))
         total   (last freqs)
 (defn one-of
   "Chooses one of the given generators with equal probability.
   The size guidance is passed verbatim to the chosen generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [choices]
   (frequency (zipmap choices (repeat 1))))
 
   "Choose one of the given elements with equal probability.
   Since the elements are \"constant\" generators the size
   guidance is ignored."
-  {:added "1.0"}
+  {:added "2.0"}
   [choices]
   (one-of (map constantly choices)))
 
 (def ^{:doc "Number of maximum retries to generate a valid value."
-       :added "1.0"}
+       :added "2.0"}
   *retries*
   2000)
 
     * :let [...]:
       Takes a normal let-style binding and makes the bindings
       available to the following generator definitions."
-  {:added "1.0"}
+  {:added "2.0"}
   [bindings & body]
   (@#'clojure.core/assert-args let-gen
        (vector? bindings)       "a vector for its bindings"
   the list is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the
   item generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [item & {:keys [length] :or {length (int)}}]
   (fn [size]
     (take (length size) (repeatedly #(item size)))))
   the vector is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the item
   generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [item & {:keys [length] :or {length (int)}}]
   (let-gen [elems (list item :length length)]
     (clojure.core/vec elems)))
   the set is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the
   item generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [item & {:keys [length] :or {length (int)}}]
   (let-gen [elems (list item :length length)]
     (clojure.core/set elems)))
   the sorted-set is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the item
   generator."
-  {:added "1.0"}
+  {:added "2.0"}
   [item & {:keys [length] :or {length (int)}}]
   (let-gen [elems (list item :length length)]
     (apply clojure.core/sorted-set elems)))
   the hash-map is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the key
   and value generators."
-  {:added "1.0"}
+  {:added "2.0"}
   [keys vals & {:keys [length] :or {length (int)}}]
   (let-gen [len length
             ks  (list keys :length (constantly len))
   the sorted-map is an integer generator. The default grows with the
   size guidance. The size guidance is passed verbatim to the key and
   value generators."
-  {:added "1.0"}
+  {:added "2.0"}
   [keys vals & {:keys [length] :or {length (int)}}]
   (let-gen [len length
             ks  (list keys :length (constantly len))
 (defn sized
   "Modify the size guidance according to f and pass it on to the
   given generator. If f is not a function it will be taken"
-  {:added "1.0"}
+  {:added "2.0"}
   [f gen]
   (let [f (if (fn? f) f (constantly f))]
     (comp gen f)))
 
 (def ^{:doc "Number of trials a property is tested with generated input.
   Default is 1000."
-       :added "1.0"}
+       :added "2.0"}
   *trials*
   1000)
 
 (defn *size-scale*
   "The scale function used to scale up the size guidance with increasing
   trials while testing a property with generated input."
-  {:added "1.0"}
+  {:added "2.0"}
   [n]
   (if (even? n)
     (/ n 2)
       for the property
     * the property test in form of a function of the generated
       input."
-  {:added "1.0"}
+  {:added "2.0"}
   [msg locals gen prop]
   (let [results   (atom [])
         report-fn #(swap! results conj %)]
   property the locals will be assigned the values generated.
 
   The body is a normal deftest body."
-  {:added "1.0"}
+  {:added "2.0"}
   [msg bindings & body]
   (let [locals (remove keyword? (take-nth 2 bindings))]
     `(property* ~msg
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.