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
Unlike expect_known_output(), which lets you pass a width argument, expect_output() has a hard-coded 80-character width. Even though capture_output() does take a width arg, expect_output() calls quasi_capture(), which calls capture_output() with no additional args, so you can't pass it through.
I'm happy to submit a patch if you can provide guidance on where you'd like it solved. My instinct would be to move the withr::local_options setting from where it is inside eval_with_output to test_file() or somewhere higher so that you can control print width options within your test files normally using options(width = whatever). You could also extend expect_output to have a width argument to match expect_known_output, but I suspect that's a bigger refactor.
The text was updated successfully, but these errors were encountered:
I think the right fix is to add an explicit width option to expect_output(). I don't think you want to inherit the width from your options because that might differ from system to system, leading to spurious failures.
Unlike
expect_known_output()
, which lets you pass awidth
argument,expect_output()
has a hard-coded 80-character width. Even thoughcapture_output()
does take a width arg,expect_output()
callsquasi_capture()
, which callscapture_output()
with no additional args, so you can't pass it through.Here's a test that illustrates:
The width check inside of
expect_output
fails:I'm happy to submit a patch if you can provide guidance on where you'd like it solved. My instinct would be to move the
withr::local_options
setting from where it is insideeval_with_output
totest_file()
or somewhere higher so that you can control print width options within your test files normally usingoptions(width = whatever)
. You could also extendexpect_output
to have a width argument to matchexpect_known_output
, but I suspect that's a bigger refactor.The text was updated successfully, but these errors were encountered: