The with-out-str macro should be able to do this for you. A few examples of use can be found on ClojureDocs here:
https://clojuredocs.org/clojure.core/with-out-str You may find the Clojure cheat sheet useful for discovering things like this (at least for things the cheat sheet includes -- it doesn't cover any but a tiny handful of functions outside of Clojure core functionality). In particular for your question, the section titled "IO" (i.e. Input/Output), subsection "to string" would have helped: https://clojure.org/api/cheatsheet Andy On Tue, May 30, 2017 at 2:43 PM, Kevin Kleinfelter < kleinfelter.gro...@gmail.com> wrote: > I've got a function which is supposed to println a computed value. How do > I test whether it printed that value, when using clojure.test? > > Or, another way of asking the same question is how do I grab the output > from println when testing a function with clojure.test? > > TIA > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.