mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
265 stars 30 forks source link

`check_number(2, lower = Inf)` is `TRUE` #237

Closed vincentarelbundock closed 1 year ago

vincentarelbundock commented 1 year ago

Thank you very much for checkmate. I use it extensively in several packages, and it is a joy to work with.

I was surprised by the following behavior. Is this expected?

checkmate::check_number(2, lower = Inf)
#> [1] TRUE

sessionInfo()
#> R version 4.2.2 Patched (2022-11-10 r83330)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 22.04 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices datasets  utils     methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] knitr_1.41           magrittr_2.0.3       R.cache_0.16.0      
#>  [4] rlang_1.0.6          fastmap_1.1.0        stringr_1.5.0       
#>  [7] styler_1.8.1         tools_4.2.2          checkmate_2.1.0-9000
#> [10] xfun_0.36            R.oo_1.25.0          cli_3.6.0           
#> [13] withr_2.5.0          htmltools_0.5.4      yaml_2.3.6          
#> [16] digest_0.6.31        lifecycle_1.0.3      purrr_1.0.0         
#> [19] vctrs_0.5.1          R.utils_2.12.1       fs_1.5.2            
#> [22] bspm_0.3.9           glue_1.6.2           evaluate_0.19       
#> [25] rmarkdown_2.19       reprex_2.0.2         stringi_1.7.8       
#> [28] compiler_4.2.2       backports_1.4.1      R.methodsS3_1.8.2
mllg commented 1 year ago

Not expected and now fixed. Thanks for reporting!

vincentarelbundock commented 1 year ago

Thanks!