From e77ca7eba90c8bdb948b61a9d6e84ca7214f52db Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Tue, 3 Apr 2018 19:29:47 +0200 Subject: [PATCH 01/11] checking can take no option and will use quick-check's default (first pass) --- .../gfredericks/test/chuck/clojure_test.cljc | 28 +++++++++++++------ .../test/chuck/clojure_test_test.cljc | 8 ++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index 7117de2..e94b8cd 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -106,7 +106,7 @@ (ct/report reports)) (defmacro checking - "A macro intended to replace the testing macro in clojure.test with a + ^{:doc "A macro intended to replace the testing macro in clojure.test with a generative form. To make (testing \"doubling\" (is (= (* 2 2) (+ 2 2)))) generative, you simply have to change it to (checking \"doubling\" 100 [x gen/int] (is (= (* 2 x) (+ x x)))). @@ -120,13 +120,25 @@ For background, see http://blog.colinwilliams.name/blog/2015/01/26/alternative-clojure-dot-test-integration-with-test-dot-check/" - [name num-tests-or-options bindings & body] - `(-testing ~name - (fn [] - (let [final-reports# (atom [])] - (qc-and-report-exception final-reports# ~num-tests-or-options ~bindings ~@body) - (doseq [r# @final-reports#] - (-report r#)))))) + :arglists '([name bindings body] [name num-tests-or-options bindings body])} + [name & check-decl] + (let [[num-tests-or-options bindings body] (cond + (and (or number? (first check-decl) + map? (first check-decl)) + (vector? (second check-decl))) + [(first check-decl) (second check-decl) (nnext check-decl)] + + (vector? (first check-decl)) + [nil (first check-decl) (next check-decl)] + + :else (throw (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] [name num-tests-or-options bindings body] or [name num-tests-or-options bindings body]"))) + num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] + `(-testing ~name + (fn [] + (let [final-reports# (atom [])] + (qc-and-report-exception final-reports# ~num-tests-or-options ~bindings ~@body) + (doseq [r# @final-reports#] + (-report r#))))))) (defmacro for-all "An alternative to clojure.test.check.properties/for-all that uses diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 1733c10..7b83127 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -11,7 +11,15 @@ (checking "negative" 100 [i gen/s-neg-int] (is (< i 0)))) +(def nb-runs (atom 0)) + (deftest options-test + ;; no option is OK, defaults to 100 tests + (checking "no option works" [i gen/s-pos-int] + (swap! nb-runs inc) + (is (> 0))) + (testing "no option means 100 runs (test.check's default)" + (is (= 100 @nb-runs))) ;; empty map is OK, defaults to 100 tests (checking "strings are strings" {} [s gen/string-ascii] (is (string? s))) From dd5ad5f380c344b04b8234eca92f3f0995463cac Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Wed, 4 Apr 2018 10:38:38 +0200 Subject: [PATCH 02/11] Small refinements to code and tests --- src/com/gfredericks/test/chuck/clojure_test.cljc | 15 +++++++-------- .../gfredericks/test/chuck/clojure_test_test.cljc | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index e94b8cd..f8f6f0e 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -88,14 +88,13 @@ (defmacro qc-and-report-exception [final-reports num-tests-or-options bindings & body] `(report-exception-or-shrunk - (let [num-tests-or-options# ~num-tests-or-options] - (apply tc/quick-check - (times num-tests-or-options#) - (prop/for-all ~bindings - (let [reports# (capture-reports ~@body)] - (swap! ~final-reports save-to-final-reports reports#) - (pass? reports#))) - (apply concat (options num-tests-or-options#)))))) + (apply tc/quick-check + (times ~num-tests-or-options) + (prop/for-all ~bindings + (let [reports# (capture-reports ~@body)] + (swap! ~final-reports save-to-final-reports reports#) + (pass? reports#))) + (apply concat (options ~num-tests-or-options))))) (defn -testing [name func] diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 7b83127..d614b31 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -11,18 +11,17 @@ (checking "negative" 100 [i gen/s-neg-int] (is (< i 0)))) -(def nb-runs (atom 0)) - (deftest options-test ;; no option is OK, defaults to 100 tests - (checking "no option works" [i gen/s-pos-int] - (swap! nb-runs inc) - (is (> 0))) - (testing "no option means 100 runs (test.check's default)" - (is (= 100 @nb-runs))) + (let [nb-runs (atom 0)] + (checking "no option works" [i gen/s-pos-int] + (swap! nb-runs inc) + (is (> 0))) + (testing "no option means 100 runs (test.check's default)" + (is (= 100 @nb-runs)))) ;; empty map is OK, defaults to 100 tests (checking "strings are strings" {} [s gen/string-ascii] - (is (string? s))) + (is (string? s))) ;; passes because the number of tests is small (checking "small ints" {:num-tests 5} [i gen/s-pos-int] (is (< i 10))) From 2dd538aeff24f99f0e9b16dbd33810439f769859 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Wed, 4 Apr 2018 10:59:23 +0200 Subject: [PATCH 03/11] Update documentation --- README.md | 2 +- src/com/gfredericks/test/chuck/clojure_test.cljc | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c832bbe..108493f 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ The `checking` macro is intended to be used with '[com.gfredericks.test.chuck.clojure-test :refer [checking]]) (deftest my-test - (checking "that positive numbers are positive" 100 + (checking "that positive numbers are positive" [x gen/s-pos-int] (is (pos? x)) (is (> x 0)))) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index f8f6f0e..51aa336 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -108,11 +108,15 @@ ^{:doc "A macro intended to replace the testing macro in clojure.test with a generative form. To make (testing \"doubling\" (is (= (* 2 2) (+ 2 2)))) generative, you simply have to change it to - (checking \"doubling\" 100 [x gen/int] (is (= (* 2 x) (+ x x)))). + (checking \"doubling\" [x gen/int] (is (= (* 2 x) (+ x x)))). - You can optionally pass in a map options instead of the number of tests, + You can optionally pass in a number of a map options, which will be passed to `clojure.test.check/quick-check`, e.g.: + (checking \"doubling\" 100 + [x gen/int] + (is (= (* 2 x) (+ x x)))) + (checking \"doubling\" {:num-tests 100 :seed 123 :max-size 10} [x gen/int] (is (= (* 2 x) (+ x x)))) @@ -130,7 +134,7 @@ (vector? (first check-decl)) [nil (first check-decl) (next check-decl)] - :else (throw (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] [name num-tests-or-options bindings body] or [name num-tests-or-options bindings body]"))) + :else (throw (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]"))) num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] `(-testing ~name (fn [] From 810782c9ead9fbf2b49e9b1e667392b30378bb8a Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Wed, 4 Apr 2018 11:05:17 +0200 Subject: [PATCH 04/11] Fix error throwing for cljs --- src/com/gfredericks/test/chuck/clojure_test.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index 51aa336..d1d00ef 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -134,7 +134,8 @@ (vector? (first check-decl)) [nil (first check-decl) (next check-decl)] - :else (throw (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]"))) + :else (throw #?(:clj (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]") + :cljs (js/Error. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]")))) num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] `(-testing ~name (fn [] From 03240d7d6f60fb9495b54a7a42d30d945f55b992 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Thu, 5 Apr 2018 14:43:20 +0200 Subject: [PATCH 05/11] Indentation and parens fixes after code review. Node tests still on error :( --- .../gfredericks/test/chuck/clojure_test.cljc | 27 ++++++++++--------- .../test/chuck/clojure_test_test.cljc | 6 ++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index d1d00ef..733637a 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -105,7 +105,7 @@ (ct/report reports)) (defmacro checking - ^{:doc "A macro intended to replace the testing macro in clojure.test with a + {:doc "A macro intended to replace the testing macro in clojure.test with a generative form. To make (testing \"doubling\" (is (= (* 2 2) (+ 2 2)))) generative, you simply have to change it to (checking \"doubling\" [x gen/int] (is (= (* 2 x) (+ x x)))). @@ -123,19 +123,20 @@ For background, see http://blog.colinwilliams.name/blog/2015/01/26/alternative-clojure-dot-test-integration-with-test-dot-check/" - :arglists '([name bindings body] [name num-tests-or-options bindings body])} + :arglists '([name bindings & body] [name num-tests-or-options bindings & body])} [name & check-decl] - (let [[num-tests-or-options bindings body] (cond - (and (or number? (first check-decl) - map? (first check-decl)) - (vector? (second check-decl))) - [(first check-decl) (second check-decl) (nnext check-decl)] - - (vector? (first check-decl)) - [nil (first check-decl) (next check-decl)] - - :else (throw #?(:clj (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]") - :cljs (js/Error. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]")))) + (let [[num-tests-or-options bindings body] + (cond + (and (or (number? (first check-decl)) + (map? (first check-decl))) + (vector? (second check-decl))) + [(first check-decl) (second check-decl) (nnext check-decl)] + + (vector? (first check-decl)) + [nil (first check-decl) (next check-decl)] + + :else (throw #?(:clj (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]") + :cljs (js/Error. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]")))) num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] `(-testing ~name (fn [] diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index d614b31..4846551 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -15,13 +15,13 @@ ;; no option is OK, defaults to 100 tests (let [nb-runs (atom 0)] (checking "no option works" [i gen/s-pos-int] - (swap! nb-runs inc) - (is (> 0))) + (swap! nb-runs inc) + (is (> 0))) (testing "no option means 100 runs (test.check's default)" (is (= 100 @nb-runs)))) ;; empty map is OK, defaults to 100 tests (checking "strings are strings" {} [s gen/string-ascii] - (is (string? s))) + (is (string? s))) ;; passes because the number of tests is small (checking "small ints" {:num-tests 5} [i gen/s-pos-int] (is (< i 10))) From 8a8085d8d86c3f62cfa0e1da87920782536009e0 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Thu, 5 Apr 2018 15:52:45 +0200 Subject: [PATCH 06/11] Fix node test, other fixes after 2nd review, new test KO in clj (OK cljs) --- src/com/gfredericks/test/chuck/clojure_test.cljc | 4 ++-- .../com/gfredericks/test/chuck/clojure_test_test.cljc | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index 733637a..f071141 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -135,8 +135,8 @@ (vector? (first check-decl)) [nil (first check-decl) (next check-decl)] - :else (throw #?(:clj (IllegalArgumentException. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]") - :cljs (js/Error. "Arguments to `checking` must be either [name bindings body] or [name num-tests-or-options bindings body]")))) + :else (throw (#?(:clj IllegalArgumentException. + :cljs js/Error.) "Arguments to `checking` must be either [name bindings & body] or [name num-tests-or-options bindings & body]"))) num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] `(-testing ~name (fn [] diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 4846551..9f52634 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -1,6 +1,6 @@ (ns com.gfredericks.test.chuck.clojure-test-test (:require #?(:clj [clojure.test :refer :all]) - #?(:cljs [cljs.test :refer-macros [deftest is]]) + #?(:cljs [cljs.test :refer-macros [deftest is testing]]) [clojure.test.check :refer [quick-check]] [clojure.test.check.generators :as gen] [com.gfredericks.test.chuck.clojure-test #?(:clj :refer :cljs :refer-macros) [checking for-all]])) @@ -16,7 +16,7 @@ (let [nb-runs (atom 0)] (checking "no option works" [i gen/s-pos-int] (swap! nb-runs inc) - (is (> 0))) + (is (pos? i))) (testing "no option means 100 runs (test.check's default)" (is (= 100 @nb-runs)))) ;; empty map is OK, defaults to 100 tests @@ -30,7 +30,12 @@ (is (contains? #{-1 0 1} i))) ;; passes because of max-size (checking "short strings" {:num-tests 100 :max-size 9} [s gen/string-ascii] - (is (< (count s) 10)))) + (is (< (count s) 10))) + ;; bad options throws + (testing "bad option throws" + (is (thrown? #?(:clj IllegalArgumentException :cljs js/Object) + (checking "numbers are numbers" "opts as string" [i gen/int] + (is (int? i))))))) (deftest counter (checking "increasing" 100 [i gen/s-pos-int] From 81ce71932ef31038c752885c300df27dd3ef68d5 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Fri, 6 Apr 2018 10:24:15 +0200 Subject: [PATCH 07/11] Explicit reference to defspec options in `testing` docstring --- src/com/gfredericks/test/chuck/clojure_test.cljc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index f071141..484e144 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -110,14 +110,14 @@ generative, you simply have to change it to (checking \"doubling\" [x gen/int] (is (= (* 2 x) (+ x x)))). - You can optionally pass in a number of a map options, + You can optionally pass the same options as test.check's defspec, which will be passed to `clojure.test.check/quick-check`, e.g.: - (checking \"doubling\" 100 + (checking \"doubling\" 100 ;; number [x gen/int] (is (= (* 2 x) (+ x x)))) - (checking \"doubling\" {:num-tests 100 :seed 123 :max-size 10} + (checking \"doubling\" {:num-tests 100 :seed 123 :max-size 10} ;; options map [x gen/int] (is (= (* 2 x) (+ x x)))) From 0939c8a61234a8eb627f54a0ae5659fdf686bd07 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Fri, 6 Apr 2018 18:36:48 +0200 Subject: [PATCH 08/11] Test that catch exception with bad options works OK in CLJ and CLJS \o/ --- test/com/gfredericks/test/chuck/clojure_test_test.cljc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 9f52634..736580c 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -34,8 +34,8 @@ ;; bad options throws (testing "bad option throws" (is (thrown? #?(:clj IllegalArgumentException :cljs js/Object) - (checking "numbers are numbers" "opts as string" [i gen/int] - (is (int? i))))))) + (eval `(checking "numbers are numbers" "opts as string" [i gen/int] + (is (int? i)))))))) (deftest counter (checking "increasing" 100 [i gen/s-pos-int] From 122068e95f6f96916eb40beeabf9720a8780b317 Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Mon, 16 Apr 2018 14:49:11 +0200 Subject: [PATCH 09/11] Changes after review; still got some macro problems --- .../gfredericks/test/chuck/clojure_test.cljc | 27 +++++++++---------- .../test/chuck/clojure_test_test.cljc | 4 +++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/com/gfredericks/test/chuck/clojure_test.cljc b/src/com/gfredericks/test/chuck/clojure_test.cljc index 484e144..1522130 100644 --- a/src/com/gfredericks/test/chuck/clojure_test.cljc +++ b/src/com/gfredericks/test/chuck/clojure_test.cljc @@ -88,13 +88,14 @@ (defmacro qc-and-report-exception [final-reports num-tests-or-options bindings & body] `(report-exception-or-shrunk - (apply tc/quick-check - (times ~num-tests-or-options) - (prop/for-all ~bindings - (let [reports# (capture-reports ~@body)] - (swap! ~final-reports save-to-final-reports reports#) - (pass? reports#))) - (apply concat (options ~num-tests-or-options))))) + (let [num-tests-or-options# ~num-tests-or-options] + (apply tc/quick-check + (times num-tests-or-options#) + (prop/for-all ~bindings + (let [reports# (capture-reports ~@body)] + (swap! ~final-reports save-to-final-reports reports#) + (pass? reports#))) + (apply concat (options num-tests-or-options#)))))) (defn -testing [name func] @@ -127,21 +128,19 @@ [name & check-decl] (let [[num-tests-or-options bindings body] (cond - (and (or (number? (first check-decl)) - (map? (first check-decl))) - (vector? (second check-decl))) + (vector? (second check-decl)) [(first check-decl) (second check-decl) (nnext check-decl)] (vector? (first check-decl)) [nil (first check-decl) (next check-decl)] :else (throw (#?(:clj IllegalArgumentException. - :cljs js/Error.) "Arguments to `checking` must be either [name bindings & body] or [name num-tests-or-options bindings & body]"))) - num-tests-or-options (tc.clojure-test/process-options num-tests-or-options)] + :cljs js/Error.) "Arguments to `checking` must be either [name bindings & body] or [name num-tests-or-options bindings & body]")))] `(-testing ~name (fn [] - (let [final-reports# (atom [])] - (qc-and-report-exception final-reports# ~num-tests-or-options ~bindings ~@body) + (let [final-reports# (atom []) + num-tests-or-options# (tc.clojure-test/process-options ~num-tests-or-options)] + (qc-and-report-exception final-reports# num-tests-or-options# ~bindings ~@body) (doseq [r# @final-reports#] (-report r#))))))) diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 736580c..9c0dbee 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -31,6 +31,10 @@ ;; passes because of max-size (checking "short strings" {:num-tests 100 :max-size 9} [s gen/string-ascii] (is (< (count s) 10))) + ;; using non-literal expression as option + (let [opts {:max-size 9}] + (checking "short strings again" (assoc opts :num-tests 100) [s gen/string-ascii] + (is (< (count s) 10)))) ;; bad options throws (testing "bad option throws" (is (thrown? #?(:clj IllegalArgumentException :cljs js/Object) From ff4857216bea7976844aaddcca3b4e7d7a840dcf Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Mon, 16 Apr 2018 14:53:54 +0200 Subject: [PATCH 10/11] Quoted binding to avoid passing fully-qualified name --- test/com/gfredericks/test/chuck/clojure_test_test.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 9c0dbee..0e71746 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -38,7 +38,7 @@ ;; bad options throws (testing "bad option throws" (is (thrown? #?(:clj IllegalArgumentException :cljs js/Object) - (eval `(checking "numbers are numbers" "opts as string" [i gen/int] + (eval `(checking "numbers are numbers" "opts as string" '[i gen/int] (is (int? i)))))))) (deftest counter From a11771a6bf66e1b1e84ef865d47669ae10bf73af Mon Sep 17 00:00:00 2001 From: DjebbZ Date: Wed, 16 May 2018 10:04:57 +0200 Subject: [PATCH 11/11] Fix integer? and try fixing remaining uncaught exception --- test/com/gfredericks/test/chuck/clojure_test_test.cljc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/com/gfredericks/test/chuck/clojure_test_test.cljc b/test/com/gfredericks/test/chuck/clojure_test_test.cljc index 0e71746..053a03d 100644 --- a/test/com/gfredericks/test/chuck/clojure_test_test.cljc +++ b/test/com/gfredericks/test/chuck/clojure_test_test.cljc @@ -37,9 +37,9 @@ (is (< (count s) 10)))) ;; bad options throws (testing "bad option throws" - (is (thrown? #?(:clj IllegalArgumentException :cljs js/Object) - (eval `(checking "numbers are numbers" "opts as string" '[i gen/int] - (is (int? i)))))))) + (is (thrown? #?(:clj Exception :cljs js/Object) + (eval `(checking "numbers are numbers" "opts as string" [i# gen/int] + (is (integer? i#)))))))) (deftest counter (checking "increasing" 100 [i gen/s-pos-int]