This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-22
Channels
- # beginners (240)
- # boot (23)
- # bristol-clojurians (3)
- # cider (101)
- # cljs-dev (52)
- # cljsrn (17)
- # clojure (212)
- # clojure-dusseldorf (2)
- # clojure-greece (2)
- # clojure-italy (9)
- # clojure-russia (1)
- # clojure-spec (91)
- # clojure-uk (33)
- # clojurescript (164)
- # community-development (23)
- # core-async (24)
- # core-logic (9)
- # cursive (18)
- # datavis (1)
- # datomic (119)
- # emacs (13)
- # events (1)
- # figwheel (2)
- # fulcro (86)
- # graphql (1)
- # immutant (5)
- # jobs-discuss (6)
- # leiningen (19)
- # lumo (46)
- # nyc (7)
- # off-topic (23)
- # parinfer (15)
- # pedestal (3)
- # planck (32)
- # re-frame (48)
- # reagent (75)
- # ring-swagger (13)
- # rum (32)
- # shadow-cljs (402)
- # spacemacs (5)
- # specter (3)
- # tools-deps (11)
- # unrepl (20)
- # vim (135)
- # yada (3)
månmån
Morn-morn
I think 🌅 is a pretty accurate summation of the day 😎
What's it like up north?
@mccraigmccraig any chance of you coming through to Horsham next Wednesday evening? I know you said you might have something on
i'm planning on coming @yogidevbear - there are apparently no invisible appointments in my calendar 🙂
(it's the invisible, yet unavoidable, appointments that always trip me up)
I can relate to those 🙂 Well, hopefully we'll see you there
our latest cassandra stream-joining stuff is looking pretty good now @otfrom https://gist.github.com/mccraigmccraig/ff1b7fc16eef3a37d1f0d6770fdae9c0
I just solved this after a bit of headscratching... anyone want to have a guess at this?
(testing (is (thrown? AssertionError (assert (= 1 0)))))
;; 0 failures, 0 errors.
(testing (is (thrown? AssertionError (map #(assert (= % 0)) [1]))))) ;; edited from (assert (map #(= % 0) [1]))
;; FAIL
;; expected: (thrown? AssertionError (assert (map (fn* [p1__21975#] (= p1__21975# 0)) [1])))
;; actual: nil
So in the first case: I have a top level assert. In the second: I am trying to assert a property across a sequence
But the result of the map
is [false]
, and that always asserts true. But what you meant to do was (run! assert)
over that.
I just ran this in the repl:
user=> (map #(assert (= % 1)) [1])
(nil)
user=> (map #(assert (= % 1)) [0])
AssertionError Assert failed: (= p1__23074# 1) forecast-watcher.core/eval23075/fn--23076 (form-init2564455833876217160.clj:1)
You were on the mark with run!
though, I was surprised to find out that thrown?
doesn't realise lazy results
So to complete the rest:
(testing (is (thrown? AssertionError (assert (= 1 0)))))
;; 0 failures, 0 errors.
(testing (is (thrown? AssertionError (map #(assert (= % 0)) [1]))))
;; FAIL
;; expected: (thrown? AssertionError (assert (map (fn* [p1__21975#] (= p1__21975# 0)) [1])))
;; actual: nil
(testing (is (thrown? AssertionError (doall (map #(assert (= % 0)) [1])))))
;; 0 failures, 0 errors.
(testing (is (thrown? AssertionError (mapv #(assert (= % 0)) [1]))))
;; 0 failures, 0 errors.