You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evalue (is (= exp act)) only once when failing the equality test (#713)
Hi,
could you please review patch to have `(is (= exp act)` evaluate its
argument only once when failing. It fixes#712.
Previously, the arguments were evaluated once in the `when` close, and
then once more in the `:actual` and `:expected` keys.
I haven't introduced a test case, because this issue manifest itself
only when the test fails, which inadvertently will fail the test suite.
Thus I was expecting perhaps you could reason about its behavior for the
review?
(Though now that I think of it, it might be possible to write a test
case for the `gen-assert` multimethod rather than the `is` case which
will fail the test suite)
Here are the result running the same test in #712 with the fix, it only
prints `:5` once as expected this time:
``` clojure
basilisp.user=> (require '[basilisp.test :refer [deftest is]])
nil
basilisp.user=> (deftest issue
(is (= 8 (println :5))))
#'basilisp.user/issue
basilisp.user=> (issue)
:5
{:failures [{:actual nil :message "Test failure: (= 8 (println :5))" :test-section nil :type :failure :expr (= 8 (println :5)) :expected 8 :test-name "issue" :line 2}]}
```
Thanks
Co-authored-by: ikappaki <[email protected]>
0 commit comments