You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I'll sprinkle printlns throughout a comment to demonstrate side effects or order of events.
Like
(comment
(try
(println"Happens first")
(throw (ex-info"" {}))
(catch Exception e (println"Happens after exception"))
(finally (println"Happens last no matter what")))
)
It'd be nice to have a helper to assert this behavior with rct, something like:
^:rct/test
(comment
(with-printlns
(try
(println"Happens first")
(throw (ex-info"" {}))
(catch Exception e (println"Happens after exception"))
(finally (println"Happens last no matter what"))))
;=>> ["Happens first" ; "Happens after exception" ; "Happens last no matter what"]
)
I want something different than with-out-str because (1) I want it to still print, and (2) sometimes weird binding conveyance stuff happens with with-out-str.
The downside would be that if this goes in a util namespace or something, anyone who wants to use it would want to depend on rct within the codebase under test.
But it would be optional, so no forced dependency.
Sometimes I'll sprinkle printlns throughout a
comment
to demonstrate side effects or order of events.Like
(Or more realistically, see this comment from ptaoussanis.)
It'd be nice to have a helper to assert this behavior with rct, something like:
I want something different than
with-out-str
because (1) I want it to still print, and (2) sometimes weird binding conveyance stuff happens withwith-out-str
.E.g. using the promesa library:
The "Finally" is printed and the rest is captured by
with-out-str
.The text was updated successfully, but these errors were encountered: