Last active
November 3, 2018 02:39
-
-
Save mfikes/19e8d1983c9c594ada8ca2a21448c77a to your computer and use it in GitHub Desktop.
Patching check
This file contains hidden or 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 repro.patch) | |
| #?(:cljs (defn checkable-syms* | |
| ([] | |
| (checkable-syms* nil)) | |
| ([opts] | |
| (reduce into #{} | |
| [(filter js/cljs.spec.test.alpha$macros.fn_spec_name_QMARK_ (keys @js/cljs.spec.alpha$macros.registry_ref)) | |
| (keys (:spec opts))])))) | |
| #?(:cljs (defmacro fix-check [] | |
| (when (exists? js/PLANCK_VERSION) | |
| (set! js/cljs.spec.test.alpha$macros.checkable_syms_STAR_ checkable-syms*))) | |
| :clj (defmacro fix-check [])) |
This file contains hidden or 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 repro.patch | |
| (:require-macros repro.patch)) |
This file contains hidden or 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 repro.weird | |
| (:require | |
| [repro.patch] ;; NEW LINE | |
| [clojure.spec.alpha :as s] | |
| [clojure.spec.test.alpha :as stest] | |
| [clojure.test :as t :refer [deftest is testing]] | |
| [clojure.test.check] | |
| ;; [speculative.test-test] | |
| ;; [speculative.core-test] | |
| [clojure.test])) | |
| (repro.patch/fix-check) ;; NEW LINE | |
| (defn foo [n] | |
| "ret") | |
| (s/fdef foo | |
| :args (s/cat :n number?) | |
| :ret string?) | |
| (defn hmm [] | |
| (println "HMM" (stest/check `foo {:clojure.test.check/opts {:num-tests 42}}))) | |
| (defn -main [& args] | |
| (hmm) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment