Skip to content

Commit

Permalink
Added specs for require, use, refer, import. #22
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanUphoff committed Aug 2, 2018
1 parent 37b2053 commit 08579b4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/corefns/corefns.clj
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,45 @@

(s/fdef clojure.core/pvalues :args (s/and ::b-length-zero-or-greater (s/cat :a (s/* any?))))
(stest/instrument `clojure.core/pvalues)

(s/def ::innervector (s/cat :a symbol? :b (s/* (s/cat :a keyword :b (s/or :a symbol?
:b (s/nilable coll?))))))
(s/def ::requiredlist (s/or :a (s/cat :a symbol?)
:b (s/cat :a symbol? :b (s/and vector? ::innervector))))
(s/def ::requirelist (s/and list? ::requiredlist))
(s/def ::requiredvector (s/or :a (s/cat :a symbol?)
:b (s/cat :a symbol? :b (s/* (s/cat :a keyword? :b (s/or :a symbol?
:b (s/nilable coll?)
:c keyword?))))
:c (s/cat :a symbol? :b (s/and vector? ::innervector))))
(s/def ::requirevector (s/and vector? ::requiredvector))
(s/def ::importlists (s/and (s/nilable coll?) ::importlist))
(s/def ::importlist (s/cat :a (s/+ (s/or :a string?
:b symbol?
:c class?
:d ::quotelist))))
(s/def ::quotelist (s/cat :a (s/+ (s/or :a string?
:b symbol?
:c class?))))

(s/fdef clojure.core/require
:args (s/and ::b-length-greater-zero
(s/+ (s/cat :a (s/or :a ::requirelist :b ::requirevector :c symbol? :d class?) :b (s/* keyword?)))))
(stest/instrument `clojure.core/require)

(s/fdef clojure.core/use
:args (s/and ::b-length-greater-zero
(s/cat :a (s/+ (s/or :a ::requirelist :b ::requirevector :c symbol? :d class?)) :b (s/* keyword?))))
(stest/instrument `clojure.core/use)

(s/fdef clojure.core/refer
:args (s/and ::b-length-greater-zero
(s/cat :a symbol? :b (s/* (s/cat :a keyword? :b (s/* (s/nilable coll?)))))))
(stest/instrument `clojure.core/refer)

(s/fdef clojure.core/import
:args (s/and ::b-length-zero-or-greater
(s/cat :a (s/* (s/or :a symbol?
:b ::importlists
:c class?)))))
(stest/instrument `clojure.core/import)

0 comments on commit 08579b4

Please sign in to comment.