Skip to content

Commit

Permalink
[new] [Signals] Add shared utils tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Oct 30, 2024
1 parent a649ee7 commit 1d97ae0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/taoensso/encore_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,17 @@
(testing "Dynamic middleware (`*middleware*`)"
[(is (= (binding [rns/*middleware* identity] rns/*middleware*) identity) "via `binding`")
(is (= (rns/with-middleware identity rns/*middleware*) identity) "via `with-middleware`")
(is (= (rns/with-middleware inc (rns/with-middleware+ #(* 2 %) (rns/*middleware* 1))) 4) "via `with-middleware+`")])])
(is (= (rns/with-middleware inc (rns/with-middleware+ #(* 2 %) (rns/*middleware* 1))) 4) "via `with-middleware+`")])

(testing "Utils"
[(is (= (sigs/upper-qn :foo/bar) "FOO/BAR"))

(is (= (sigs/format-level :info) "INFO"))
(is (= (sigs/format-level 8) "LEVEL:8"))

(is (= (sigs/format-id "foo.bar" :foo.bar/qux) "::qux"))
(is (= (sigs/format-id "foo.baz" :foo.bar/qux) ":foo.bar/qux"))
(is (= (sigs/format-id nil :foo.bar/qux) ":foo.bar/qux"))])])

;;;;

Expand Down

0 comments on commit 1d97ae0

Please sign in to comment.