-
Notifications
You must be signed in to change notification settings - Fork 1k
DT() follow up #5113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DT() follow up #5113
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5113 +/- ##
=======================================
Coverage 99.53% 99.53%
=======================================
Files 76 76
Lines 14448 14459 +11
=======================================
+ Hits 14381 14392 +11
Misses 67 67
Continue to review full report at Codecov.
|
There is a trick I did in if (suppressPackageStartupMessages(requireNamespace("knitr", quietly = TRUE))) {
require(knitr)
knit("knitr.Rmd", quiet=TRUE)
cat(readLines("knitr.md"), sep="\n")
invisible(file.remove("knitr.md"))
} else {
cat(readLines("knitr.Rout.mock", warn = FALSE), sep="\n")
}and then mock file is just expected output. So in this case instead of |
|
We can also use .Rin files I believe:
|
Follows #5104
Closes #5106 by making
DT()always print. This printing can't be tested afaik becausetest()usescapture.output()which always invokes the printed output. That's whytests/autoprint.Rexists because that's the only known way to test R's autoprinting mechanism (i.e. what happens at the R prompt). However, we can't add a|>test to that because|>depends on R>4.1.0 and any sort of conditional like that will change the scripts output (autoprint.Rout) which gets compared against the fixedautoprint.Rout.save. However, since the always-print solution is simple and absolute, and there's no known way, then I think it's acceptable to proceed.Closes #5107. All tests added.