Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

catalamarti
Copy link

does this looks like it is going in the right direction? @lionel-

@catalamarti catalamarti marked this pull request as draft August 15, 2024 22:11
Copy link
Member

@lionel- lionel- left a 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")
Copy link
Member

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,
Copy link
Member

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({
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants