-
Notifications
You must be signed in to change notification settings - Fork 138
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
start check_numbers_decimal #1743
base: main
Are you sure you want to change the base?
Conversation
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.
A few comments but looking good. Also need to add a news bullet at the top of the standalone file.
@@ -253,6 +256,10 @@ check_number_whole <- function(x, | |||
what <- "a whole number" | |||
} | |||
|
|||
if (vector) { | |||
what <- sprintf("%s vector") |
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.
missing an argument?
..., | ||
exit_code = exit_code, | ||
allow_decimal = TRUE, | ||
vector = TRUE, |
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.
Potential upgrade: Should probably pass the indices of the failing elements, as well as the reasons, so they can be reported in the error message. These should be truncated if there are too many.
But in a first pass it's fine to just fail saying all elements in the vector should follow the required invariants.
expect_null(check_numbers_decimal(c(10, 5.5))) | ||
expect_null(check_numbers_decimal(c(10L, 50L))) | ||
|
||
expect_snapshot({ |
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.
It looks like you still need to generate and commit this snapshot.
does this looks like it is going in the right direction? @lionel-