Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xsc/ronda-gen
test.check generators for ronda (and other) schemas
https://github.com/xsc/ronda-gen
Last synced: 27 days ago
JSON representation
test.check generators for ronda (and other) schemas
- Host: GitHub
- URL: https://github.com/xsc/ronda-gen
- Owner: xsc
- License: epl-1.0
- Created: 2015-02-12T01:13:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-02-12T01:43:03.000Z (over 9 years ago)
- Last Synced: 2024-04-13T20:55:14.914Z (7 months ago)
- Language: Clojure
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ronda-gen
__ronda-gen__ offers [test.check][test-check] generators based on
[prismatic/schema][schema].See [schema-gen][schema-gen] for a similar (and in parts surely identical)
approach.## Usage
Don't.
```clojure
(require '[ronda.gen :as r]
'[schema.core :as s])(r/sample
{:first-name s/Str
:last-name s/Str
:age (s/both s/Int (s/pred #(>= % 18)))}
5)
;; => ({:first-name "", :last-name "", :age 18}
;; {:first-name "", :last-name "S", :age 23}
;; {:first-name "", :last-name "", :age 18}
;; {:first-name "", :last-name "CgF", :age 21}
;; {:first-name "s", :last-name "aRkl", :age 22})(r/generator {:x s/Int})
;; => #clojure.test.check.generators.Generator{:gen ...}
```## License
Copyright © 2015 Yannick Scherer
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.[schema]: https://github.com/prismatic/schema
[test-check]: https://github.com/clojure/test.check
[schema-gen]: https://github.com/zeeshanlakhani/schema-gen