NEWS


testdat 0.4.2.9000

testdat 0.4.2 (2023-09-03)

testdat 0.4.1 (2022-08-25)

expect_all(everything(), is.numeric, data = iris):
#> Error: `iris` has 150 records failing  `is.numeric` on variable `Species`.
#>  Vars: everything()
#>  Filter: None
#>  Arguments: `` 

expect_all() sits behind many other expectations, which will also see a change to their failure message.

testdat 0.4.0 (2022-01-04)

mtcars %E>%
  expect_base(mpg, TRUE) %>%
  mutate(mpg = NA) %E>%
  expect_base(mpg, FALSE)

This is a shorthand way of piping into the with_testdata() function.

mtcars %>%
  with_testdata(expect_base(mpg, TRUE)) %>%
  mutate(mpg = NA) %>%
  with_testdata(expect_base(mpg, FALSE))

testdat 0.3.0 (2021-11-12)

Breaking changes

tidyselect (#36)

As of testdat 0.3.0 we have moved to the tidyselect framework for variable selections instead of dplyr::vars(). tidyselect is the successor to vars() - it's a bit cleaner, provides some nifty features like selecting columns with a predicate function using where() and finally allows us to get rid of the distinction between multi and single variable expectations.

Unfortunately this will break some code, but it's horrendously difficult to support both methods and it's best to switch before publishing to CRAN. Fortunately it's a simple fix - anywhere that you are currently using vars(), replace it with c():

# Old
expect_unique(vars(x, y))
# New
expect_unique(c(x, y))

The affected expectations are:

A small number of functions have been hard deprecated as they are now redundant:

Auto-generated expectations have also changed slightly - previously they could either accept a single unquoted variable name or a group of variables specified with vars(). They now always accept multiple columns using tidyselect syntax. As a result, the name of the first argument for these expect has changed from var to vars, so be careful if you're using this as a named argument.

tidyselect syntax allows single unquoted variable names as well as arbitrary groups of variable specifications, and all of the auto-generated expectations in the package used the single variable variant so this shouldn't break existing code.

These are all valid column specifications using tidyselect:

expect_values(a, 1:10)
expect_values(c(a, b), 1:10)
expect_values(a:c, 1:10)
expect_values(matches("^[ab]$"), 1:10)
expect_values(c(matches("^[ab]$"), c), 1:10)
expect_values(where(is.numeric), 1:10)

Others

Deprecations

Bug fixes / minor updates

testdat 0.2.0

In addition to minor updates and bug fixes, this release does three main things:

Breaking changes

Deprecations

Additions

Bug fixes

Other minor changes

testdat 0.1.0

Initial release.

Major changes from early development releases

Minor changes