change expect_silent to include object output #615
Closed
Labels
Comments
Just do the assignment inside the expectation: expect_silent(x <- foo())
expect_equal(x, 10) But you already know how to do that so I'm not sure what you want.I don't think it make sense for some ... Ooooh, all the other expectations return the first object invisibly, so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(This is softly mentioned #614, and related to it since I'm trying to replace
info
functionality.)I want to test for silence (or warning or error) from a function and still test its output. If a function is "expensive", I'd much rather not run it multiple times. However, the current
expect_silent
and family explicitly discard the object upon execution.Right now I can do
but this does not work using the NSE hack for replacing
info
. That is:That last error message isn't very useful, so I try the NSE trick:
but none of them triggers the
Error: myfunc(TRUE) produced warnings
I would expect.The text was updated successfully, but these errors were encountered: