checkmate icon indicating copy to clipboard operation
checkmate copied to clipboard

Unexpected result: `checkmate::check_numeric(list(NULL))`

Open vincentarelbundock opened this issue 2 years ago • 1 comments

Thanks for the great package! Two of my own packages depend on it and I use it all the time.

I am wondering if this behavior is intended:

checkmate::check_numeric(list(NULL))
#> [1] TRUE
checkmate::check_character(list(NULL))
#> [1] TRUE
checkmate::check_formula(list(NULL))
#> [1] "Must be a formula, not list"

It looks like the results are different – and more intuitive – in the devel version on Github.

What output should I expect when I write code that interacts with the output of this test?

Is there a CRAN release planned soon?

Thanks again!

vincentarelbundock avatar Jan 22 '22 14:01 vincentarelbundock

With checkmate 2.2.0:

checkmate::check_numeric(list(NULL))
#> [1] "Must be of type 'numeric', not 'list'"
checkmate::check_character(list(NULL))
#> [1] "Must be of type 'character', not 'list'"
checkmate::check_formula(list(NULL))
#> [1] "Must be a formula, not list"

Created on 2023-06-29 with reprex v2.0.2

So I guess this has been fixed meanwhile.

salim-b avatar Jun 28 '23 23:06 salim-b