Skip to content

protocol55/protocol55.spec.permutations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protocol55.spec.permutations

Confirm all permutations of your specs have been checked.

Rationale

Often functions require specs that meet many different outputs. Each branch or permutation is a valid path, and because of this it is possible that when checking your functions only some paths have been actually checked.

Usage

protocol55.spec.permutations/check-fn is like clojure.spec.test.alpha/check-fn but also reports whether any permutations of :ret have been unchecked.

(require '[protocol55.spec.permutations :as p])

(p/check-fn my-function (get-spec `my-function))

; success

{... :protocol55.spec.permutations.check {:result true}}

; failure

{... :protocol55.spec.permutations.check {:result {:unchecked [...]}}}

Limitations

This library uses spec-tools.parse/parse-spec when building permutations. The basic types returned are supported, but custom specs will not.

TODO

  • Support regex specs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published