Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fix incompatibility with `(str nil)` returning "nil" (#706).
* Fix `sort-by` support for maps and boolean comparator fns (#709).
* Fix `sort` support for maps and boolean comparator fns (#711).
* Fix `(is (= exp act))` should only evaluate its args once on failure (#712).

## [v0.1.0a2]
### Added
Expand Down
24 changes: 13 additions & 11 deletions src/basilisp/test.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,19 @@

(defmethod gen-assert '=
[expr msg line-num]
`(when-not ~expr
(vswap! *test-failures*
conj
{:test-name *test-name*
:test-section *test-section*
:message ~msg
:expr (quote ~expr)
:actual ~(nth expr 2)
:expected ~(second expr)
:line ~line-num
:type :failure})))
`(let [actual# ~(nth expr 2)
expected# ~(second expr)]
(when-not (= expected# actual#)
(vswap! *test-failures*
conj
{:test-name *test-name*
:test-section *test-section*
:message ~msg
:expr (quote ~expr)
:actual actual#
:expected expected#
:line ~line-num
:type :failure}))))

(defmethod gen-assert 'thrown?
[expr msg line-num]
Expand Down