>>107801894
I added some test helpers
(defn
is-thrown-ex-info-of-form
[form f]
(try
(f)
(c.test/is false "`f` did not throw.")
(catch
ExceptionInfo
e
(c.test/is
(=
(pr-str form)
(ex-message e))))))
(defn
is-thrown-ex-info-of-form-with-data
[form data f]
(try
(f)
(c.test/is false "`f` did not throw.")
(catch
ExceptionInfo
e
(c.test/is
(=
(pr-str form)
(ex-message e)))
(c.test/is
(=
(ex-data e)
data)))))
so that tests are easy
(c.test/deftest
test-new-spec
(c.me.t-helpers/is-thrown-ex-info-of-form
'(>= x 2)
#(c.me.bxty-encoding/new-spec 1 1))
(c.me.t-helpers/is-thrown-ex-info-of-form-with-data
'(>= y 2)
{'y 1}
#(c.me.bxty-encoding/new-spec 2 1)))