Skip to content

Commit

Permalink
Use built-in symbol generator
Browse files Browse the repository at this point in the history
Adapting the keyword generator results in unreadable symbols when
they start with e.g. `+4`
  • Loading branch information
gfredericks committed Mar 13, 2018
1 parent 14a1455 commit 27e2cfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/schema_generators/generators.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
s/Keyword generators/keyword
#?(:clj clojure.lang.Keyword
:cljs cljs.core/Keyword) generators/keyword
s/Symbol (generators/fmap (comp symbol name) generators/keyword)
s/Symbol generators/symbol
#?(:clj Object :cljs js/Object) generators/any
s/Any generators/any
s/Uuid generators/uuid
Expand Down
4 changes: 4 additions & 0 deletions test/schema_generators/generators_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@
50
(properties/for-all [x (generators/generator OGSchema)]
(not (s/check OGSchema x))))

(defspec readable-symbols-spec 1000
(properties/for-all [x (generators/generator s/Symbol)]
(-> x str read-string (= x))))

0 comments on commit 27e2cfa

Please sign in to comment.