This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-21
Channels
- # beginners (82)
- # bitcoin (1)
- # boot (38)
- # cider (6)
- # cljs-dev (13)
- # cljsrn (5)
- # clojure (320)
- # clojure-italy (22)
- # clojure-losangeles (6)
- # clojure-russia (55)
- # clojure-spec (25)
- # clojure-uk (48)
- # clojurescript (64)
- # component (16)
- # core-async (6)
- # cursive (54)
- # data-science (2)
- # datascript (2)
- # datomic (8)
- # docker (1)
- # ethereum (1)
- # fulcro (1)
- # garden (1)
- # graphql (16)
- # heroku (6)
- # hoplon (12)
- # jobs (4)
- # juxt (1)
- # leiningen (9)
- # off-topic (39)
- # om (13)
- # om-next (2)
- # onyx (9)
- # pedestal (2)
- # portkey (12)
- # re-frame (25)
- # reagent (6)
- # ring-swagger (4)
- # schema (1)
- # shadow-cljs (10)
- # spacemacs (11)
- # testing (19)
- # uncomplicate (1)
- # unrepl (6)
- # vim (21)
- # yada (3)
can someone help explain to me why clojure.test isn’t trying to compare the evaluation of a function I’ve written?
expected: (= (hello_world) "Hello World!")
actual: (not (= "Hello, World!" "Hello World!"))
I think you may be misunderstanding the output
the expected shows the forms, the actual shows the values
since the actual values in the form make it much easier to see what made the test fail, usually
the expected part is also useful, because it shows me exactly what form was evaluated to get a given value
(though of course you can easily see that by reading the test)
yeah I know! But the thing that’s confusing me is the expected output is more literal than I want
I fix this with a let block
that is what you are testing...
because one has a comma in it
there's a plugin, "lein difftest" that highlights data differences in assertions btw
it works with the tests you have already, it just uses different output formats to make it more clear