Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test.check rename (WIP)

  • Loading branch information...
commit a2f270ae8e6fa99f337eaff6fbb2051a66dac392 1 parent 8a15e57
@reiddraper reiddraper authored
View
6 project.clj
@@ -1,9 +1,11 @@
-(defproject reiddraper/simple-check "0.5.7-SNAPSHOT"
+(defproject org.clojure/test.check "0.5.7-SNAPSHOT"
:description "A QuickCheck inspired property-based testing library."
- :url "http://github.com/reiddraper/simple-check"
+ :url "https://github.com/clojure/test.check"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies []
+ :source-paths ["src/main/clojure"]
+ :test-paths ["src/test/clojure"]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}}
:global-vars {*warn-on-reflection* true}
View
12 src/simple_check/clojure_test.clj → ...ojure/clojure/test/check/clojure_test.clj
@@ -1,4 +1,4 @@
-(ns simple-check.clojure-test
+(ns clojure.test.check.clojure-test
(:require [clojure.test :as ct]))
(defn- assert-check
@@ -23,16 +23,16 @@
([name default-times property]
`(do
;; consider my shame for introducing a cyclical dependency like this...
- ;; Don't think we'll know what the solution is until simple-check
+ ;; Don't think we'll know what the solution is until clojure.test.check
;; integration with another test framework is attempted.
- (require 'simple-check.core)
+ (require 'clojure.test.check.core)
(defn ~(vary-meta name assoc
::defspec true
:test `#(#'assert-check (assoc (~name) :test-var (str '~name))))
([] (~name ~default-times))
([times# & {:keys [seed# max-size#] :as quick-check-opts#}]
(apply
- simple-check.core/quick-check
+ clojure.test.check.core/quick-check
times#
(vary-meta ~property assoc :name (str '~property))
(flatten (seq quick-check-opts#))))))))
@@ -43,14 +43,14 @@
* false - no reporting of trials (default)
* a function - will be passed a clojure.test/report-style map containing
- :simple-check.core/property and :simple-check.core/trial slots
+ :clojure.test.check.core/property and :simple-check.core/trial slots
* true - provides quickcheck-style trial reporting (dots) via
`trial-report-dots`
(Note that all reporting requires running `quick-check` within the scope of a
clojure.test run (via `test-ns`, `test-all-vars`, etc.)
- Reporting functions offered by simple-check include `trial-report-dots` and
+ Reporting functions offered by clojure.test.check include `trial-report-dots` and
`trial-report-periodic` (which prints more verbose trial progress information
every `*trial-report-period*` milliseconds."
false)
View
6 src/simple_check/core.clj → src/main/clojure/clojure/test/check/core.clj
@@ -1,6 +1,6 @@
-(ns simple-check.core
- (:require [simple-check.generators :as gen]
- [simple-check.clojure-test :as ct]))
+(ns clojure.test.check.core
@Bronsa Collaborator
Bronsa added a note

I see no reason for this to be clojure.test.check.core instead of simply clojure.test.check

@reiddraper Collaborator

Yeah good point. I guess the only argument would be to keep a consistent mapping between the simple-check namespaces, but it's going to be easy enough for people to use sed to change the names either way.

@lprefontaine Collaborator
@reiddraper Collaborator

Renamed in 1862c9e.

@Bronsa Collaborator
Bronsa added a note

:+1: Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ (:require [clojure.test.check.generators :as gen]
+ [clojure.test.check.clojure-test :as ct]))
(declare shrink-loop failure)
View
4 src/simple_check/generators.clj → ...clojure/clojure/test/check/generators.clj
@@ -1,4 +1,4 @@
-(ns simple-check.generators
+(ns clojure.test.check.generators
(:import java.util.Random)
(:refer-clojure :exclude [int vector list hash-map map keyword
char boolean byte bytes sequence
@@ -364,7 +364,7 @@
"
[coll]
(when (empty? coll)
- (throw (ex-info "simple-check.generators/elements called with empty collection!"
+ (throw (ex-info "clojure.test.check.generators/elements called with empty collection!"
{:collection coll})))
(gen-bind (choose 0 (dec (count coll)))
#(gen-pure (rose-fmap (partial nth coll) %))))
View
4 src/simple_check/properties.clj → ...clojure/clojure/test/check/properties.clj
@@ -1,5 +1,5 @@
-(ns simple-check.properties
- (:require [simple-check.generators :as gen]))
+(ns clojure.test.check.properties
+ (:require [clojure.test.check.generators :as gen]))
;; NOTES:
;; The fields that should be returned from each test
View
10 test/simple_check/clojure_test_test.clj → .../clojure/test/check/clojure_test_test.clj
@@ -1,8 +1,8 @@
-(ns simple-check.clojure-test-test
+(ns clojure.test.check.clojure-test-test
(:use clojure.test)
- (:require [simple-check.generators :as gen]
- [simple-check.properties :as prop]
- [simple-check.clojure-test :as ct :refer (defspec)]))
+ (:require [clojure.test.check.generators :as gen]
+ [clojure.test.check.properties :as prop]
+ [clojure.test.check.clojure-test :as ct :refer (defspec)]))
(defspec default-trial-counts
(prop/for-all* [gen/int] (constantly true)))
@@ -54,7 +54,7 @@
(let [[report-counters stdout]
(binding [ct/*report-shrinking* true
; need to keep the failure of this-is-supposed-to-fail from
- ; affecting the simple-check test run
+ ; affecting the clojure.test.check test run
*report-counters* (ref *initial-report-counters*)]
[*report-counters* (capture-test-var #'this-is-supposed-to-fail)])]
(is (== 1 (:fail @report-counters)))
View
12 test/simple_check/core_test.clj → .../clojure/clojure/test/check/core_test.clj
@@ -1,9 +1,9 @@
-(ns simple-check.core-test
+(ns clojure.test.check.core-test
(:use clojure.test)
- (:require [simple-check.core :as sc]
- [simple-check.generators :as gen]
- [simple-check.properties :as prop]
- [simple-check.clojure-test :as ct :refer (defspec)]
+ (:require [clojure.test.check.core :as sc]
+ [clojure.test.check.generators :as gen]
+ [clojure.test.check.properties :as prop]
+ [clojure.test.check.clojure-test :as ct :refer (defspec)]
[clojure.edn :as edn]))
;; plus and 0 form a monoid
@@ -121,7 +121,7 @@
(defn list-vector-round-trip-equiv
[a]
;; NOTE: can't use `(into '() ...)` here because that
- ;; puts the list in reverse order. simple-check found that bug
+ ;; puts the list in reverse order. clojure.test.check found that bug
;; pretty quickly...
(= a (apply list (vec a))))
View
10 test/simple_check/rose_tree_test.clj → ...ure/clojure/test/check/rose_tree_test.clj
@@ -1,9 +1,9 @@
-(ns simple-check.rose-tree-test
+(ns clojure.test.check.rose-tree-test
(:use clojure.test)
- (:require [simple-check.core :as sc]
- [simple-check.generators :as gen]
- [simple-check.properties :as prop]
- [simple-check.clojure-test :as ct :refer (defspec)]))
+ (:require [clojure.test.check.core :as sc]
+ [clojure.test.check.generators :as gen]
+ [clojure.test.check.properties :as prop]
+ [clojure.test.check.clojure-test :as ct :refer (defspec)]))
(defn depth-one-children
[[root children]]
Please sign in to comment.
Something went wrong with that request. Please try again.