Last active
October 20, 2018 10:29
-
-
Save slipset/645b1a785a0d6e23097e03b837b6a18b to your computer and use it in GitHub Desktop.
checking if fns are valid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:paths ["resources" "src"] | |
:deps {org.clojure/clojure {:mvn/version "RELEASE"} | |
org.clojure/test.check {:mvn/version "RELEASE"}} | |
:aliases | |
{:test {:extra-paths ["test"] | |
:extra-deps {org.clojure/test.check {:mvn/version "RELEASE"}}} | |
:runner | |
{:extra-deps {com.cognitect/test-runner | |
{:git/url "https://github.com/cognitect-labs/test-runner" | |
:sha "76568540e7f40268ad2b646110f237a60295fa3c"}} | |
:main-opts ["-m" "cognitect.test-runner" | |
"-d" "test"]}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns speculative | |
(:require [clojure.spec.alpha :as s] | |
[clojure.spec.test.alpha :as stest])) | |
;; This doesn't work all that well because it seems like | |
;; we use generative testing to verify that a higher order fn | |
;; satisfies the spec | |
(s/def ::reducing-fn (s/fspec :args (s/cat :accumulator any? :elem any?))) | |
(s/valid? ::reducing-fn (fn [x y]) ;; takes forever and ends with a out of heap memory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment