NEWS.md
NULL
is not longer considered to be atomic in future versions of R (c.f. https://stat.ethz.ch/pipermail/r-devel/2023-September/082892.html). To avoid breaking reverse dependencies, checkmate will stick to the old behavior until further notice.checkAtomic()
(#245).n.chars
and max.chars
for checkCharacter()
and checkString()
.>
instead of >=
to allow specifying a tolerance of exactly 0
(#177).Date
an POSIXt
.assertInt()
and assertIntegerish()
now round to the nearest integer instead of always rounding via trunc()
.assert()
(#182).*Matrix()
and *Array()
now allow different storage types than the one specified if all values are missing (#184).assert()
now supports collecting assertions via AssertCollection
(#112).qcheck()
(#180).checkFunction(..., ordered = TRUE)
(#204).DOUBLE_EPS
from C source.tinytest
. tinytest
is used as backend if it is attached, otherwise checkmate defaults to testthat
. There is now also a vignette on how to setup checkmate
for tinytest
.*List
.*Bit
, the bit
package is orphaned.extension
for checkPathForOutput()
(#162).expect_vector
removed due to a nameclash with package testthat
.assert*(..., coerce = TRUE)
does not drop names during conversion (#157), thanks to @mb706.checkDataFrame
(#159), thanks to @harvey131.vname()
to improve lookup of variable names.checkR6
(#156)assert
-functions now give a better error message, test
-functions are always FALSE
and expect
-functions always raise an exception.stop()
function (#117).checkDouble
to explicitly check for non-integer numerics.checkRaw
to check raw vectors.checkFormula
to check formula objects.checkMultiClass
to check for inheritance from a set of candidatescheckDisjunct
to check sets for being disjunct."p"
to qassert to check for POSIXct objects.coerce
to assertCount
/assert_count
, assertInt
/assert_int
and assertIntegerish
/assert_integerish
which optionally coerces x
to integer after an successful assertion. This supersedes the functions asCount
, asInt
and asInteger
(#77).max.rows
and max.cols
to check for maximum number of rows and columns for matrices, data.frames, tibbles and data.tables.disjunct.from
to *Names
.checkChoice
.*Function
to work properly with Primitives.*List
where the check for missingness was broken.*DataTable
for the detection of the number of rows of null data.tables: https://github.com/Rdatatable/data.table/issues/3149
*POSIXct
to check POSIXct data-time objects in POSIXct format.fastmatch
now.sorted = TRUE
is not passed to ls()
anymore to support R versions prior to v3.2.0.bit
.R6
.data.table
, tibble
, R6
or bit
. This ensures that all operations work as expected after the check.*Names
with type="unnamed"
now works with NULL
.must.include
for *Names
.rchk
.sorted
(defaults to FALSE
) for *Integer
, *Integerish
and Numeric
to check for ascending order of vector elements.null.ok
(defaults to FALSE
) for *Choice
and *Class
.*Subset
now allows to pass empty vectors to choices
.*Choice
.*Character
and *String
now ignores missing values in regular expressions and for string length checks (using argument min.chars
). To disallow missing values, set any.missing
or na.ok
, respectively.*Date
now ignores missing values in for lower/upper bound checks. To disallow missing values, set any.missing
to FALSE
. Thanks to Will Beasley (@wibeasley) for the PR.microbenchmark
is no longer strictly required to build the vignette. If not installed, some output and figures will be missing though.*Matrix
and *Array
now additionally allow to check for integerish storage type via argument “mode”.*Count
, *Int
, *Number
, *Integer
, *Integerish
and *Numeric
do not accept logical values any more.checkAtomicVector
is now more restrictive and prohibits a dimension symbol. Thus, a matrix is not considered an atomic vector any more.asInt
, asInteger
and asCount
).checkTibble
.test_file
is longer exported.*Function
does not longer lookup functions with match.fun
. As a result, passing functions via the string of the function name stopped working.qassert
using f
as first char in a rule now specifies factor (before: function).NULL
via argument null.ok
.*File
and *Directory
are deprecated due to name clashes and will be removed in a future version. Please use *FileExists
or *DirectoryExists
instead.matchArg
to provide a simple an easy way for partial argument matching in combination with an AssertCollection.check_*
) to provide support for the underscore programming style in assert()
.expect_
functions now return the checked object invisibly..var.name
for assertions and label
for expectations: They now default to the return value of the exported function vname
(instead of missing which confuses some linters).qassertr
and qtestr
where the error message was not properly generated if multiple rules were provided.depth
for qtestr
to control the recursion depth while checking nested lists.checkDate
..var.name
of assert functions now has as default value (instead of missing).*OS
functions.*Directory
functions.extension
for the *File
family of functions.checkOS()
.fixed
for *Character
functions now accepts a string instead of a boolean value and thus can directly be used for a substring search.min.chars
, pattern
, fixed
and ignore.case
for the *String
family of functions.wf
(which.first) and wl
(which.last).lengths()
and dir.exists
.assert_numeric
is the new alias for assertNumeric
and test_matrix
is the alias for test_matrix
.TRUE
and thus can be used with magrittr pipes.*DataTable
functions to properly test primary and secondary keys of data tables.*Percentage
family of functions.makeAssertion
, makeTest
and makeExpectation
to assist expanding the package with user-generated checks.makeAssertionFunction
, makeTestFunction
and makeExpectationFunction
to automatically create the respective functions based on a provided check function.makeAssertCollection()
) and reported (via reportAssertions()
).qassert()
can now perform bound checks on strings.*SetEqual
functions is now set to FALSE, as described in the documentation.testthat
anymore in order to speed up package loading times and to keep the dependencies at a minimum. The expect_*
family of functions can still be used, the namespace will be loaded on demand.expect_*
is intended to be used in combination with testthat. But note that functions expect_null()
and expect_named()
are not provided to avoid name clashes with testthat.qexpect()
and qexpectr()
.all.missing
for checks of matricies and data frames.anyNaN()
.assert()
and allMissing()
.assert()
to allow combining check functions with an AND instead of an OR.(assert|check|test)Character(NA_character_, min.chars = 1)
does not eval to TRUE anymore.*Factor
functions: (n|min|max).levels
.checkNames()
.checkPercentage()
.anyInfinite()
.checkVector()
(wrong order of arguments in call to C).qassert
.*SetEqual
: new argument “ordered”.checkPathForOutput
: new argument “overwrite”.*SetEqual
functions.assert*
functions.*Subset
functions.assert()
now returns TRUE invisibly (as documented).checkFunction()
.checkMatrix
and checkDataFrame
.