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

sorted option not enforced when sort violations bridge NA #258

Closed
bifouba opened this issue Mar 26, 2024 · 2 comments
Closed

sorted option not enforced when sort violations bridge NA #258

bifouba opened this issue Mar 26, 2024 · 2 comments

Comments

@bifouba
Copy link

bifouba commented Mar 26, 2024

This fails as expected:
checkmate::check_integerish(c(2, 1), sorted = TRUE)

The mere presence of NAs is not an issue, as these continue to fail as expected:
checkmate::check_integerish(c(2, 1, NA), sorted = TRUE)
checkmate::check_integerish(c(NA, 2, 1), sorted = TRUE)

BUT if the sort order violation is interrupted by NA, it remains unnoticed.
The following incorrectly returns TRUE:
checkmate::check_integerish(c(2, NA, 1), sorted = TRUE)

@tdeenes
Copy link
Contributor

tdeenes commented Mar 26, 2024

@mllg This is a bug in is_sorted_double. I will prepare a PR in a minute.

@tdeenes
Copy link
Contributor

tdeenes commented Mar 26, 2024

fixed in PR

@mllg mllg closed this as completed in 56b1406 Jul 17, 2024
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

No branches or pull requests

2 participants