hyperfiddle / rcf

RCF – a REPL-first, async test macro for Clojure/Script
MIT License
279 stars 12 forks source link

How to test something is equal to a non literal? #45

Closed didibus closed 2 years ago

didibus commented 2 years ago

How would I test something like:

(ex-info "error" {}) := (ex-info "error" {})

It seems the right-hand side doesn't get evaluated.

didibus commented 2 years ago

Nevermind, I thought ex-info had value equality, but they don't, so (= (ex-info "error" {}) (ex-info "error" {})) is false.

I was able to do this instead:

(let [error (ex-info "error" {})]
    error := error)
ggeoffrey commented 2 years ago

Related to #36

Both left and right hand sides are evaluated, but rhs is reported symbolically. We need to improve the overall reporting.