-
Notifications
You must be signed in to change notification settings - Fork 323
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
expect_known_results #782
Comments
I think this leads to a natural split when testing errors — you have many tests where you use cc @jennybc |
Maybe we should have a top-level equivalent to Then the test above would be become: regress_that("df.txt", {
vec_type(mtcars)
vec_type(iris)
}) This takes us the full circle back to the regression tests that base R uses extensively |
It is nice to have a single As an alternative, maybe |
TBH I am not 100% sure that we should base everything on printing. E.g. even in the simple case of having a tibble, only the first n rows will be printed, but we want to detect the differences in all rows. Maybe what we need is some special printing? Or a way to compare the full object to the reference, and then have a way to explore the differences if a test fails? |
I think printing gets you 90% of the way there, and you can always customise the printing. The disadvantage of basically any other approach is that you lose nice diffs. |
Yeah, but you only need the diffs if a test case fails. So I think I would
To make it more flexible, we could have a |
There's diffobj which specializes on object diffs for testing. |
That behaviour is still just a special case of running arbitrary code in an Rmd 😄 |
Yeah, I am not arguing against the Rmds. Only against comparing the printouts instead of comparing the objects. |
Needs option to set override |
I've noticed that I've started writing output regression tests like this:
This is starting to feel like a poor man's knitr, which made me realise we need
expect_known_something()
that uses evaluate to show both the input code and the output results.This would subsume #681 (assuming we added crayon options) and #768.
The text was updated successfully, but these errors were encountered: