-
Notifications
You must be signed in to change notification settings - Fork 340
Overhaul expect_matches()
#2138
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
Conversation
Use `expect_snapshot_failure()` to look at more of the messaging, and then use that to make a bunch of minor improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| check_character(object) | ||
| check_string(regexp) | ||
| check_bool(perl) | ||
| check_bool(fixed) | ||
| check_bool(all) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labelis likely checked above byquasi_label(), do we want to checkinfo? It's still used in the empty case below.- Do you want to take this as an opportunity to add a
grepl_args = list()(or= NULL) argument and soft-deprecate...(with a lifecycle warning)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care that much about info since we're phasing it out in new expectations.
I don't want to do any bigger refactorings because if I did I'd really want to stop it from being vectorising and instead make it work with a single string; but that's going to break a bunch of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the all argument for enforcing a scalar? all = NA or all = "scalar" would mean to expect a scalar, with a lifecycle warning to add all = TRUE if a non-scalar is provided without setting all ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's important enough to do all that work.
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
Use
expect_snapshot_failure()to look at more of the messaging, and then use that to make a bunch of minor improvements.Fixes #2135