Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 4, 2024
1 parent 26412c6 commit 2d910d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/testthat/test-get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ test_that("get_data, can't parse subset", {
subset = eval(parse(text = subset))
)
}
m <- fit_mod(formula = "mpg~gear", data = mtcars, subset = "gear != 8")
m <- fit_mod(formula = "mpg~gear", data = mtcars, subset = "cyl != 8")
expect_warning(
{
out <- get_data(m)
Expand All @@ -532,4 +532,9 @@ test_that("get_data, can't parse subset", {
)
expect_named(out, c("mpg", "gear"))
expect_identical(nrow(out), 32L)

m <- lm(mpg ~ gear, data = mtcars, subset = cyl != 8)
out <- get_data(m)
expect_named(out, c("mpg", "gear", "cyl"))
expect_identical(nrow(out), 18L)
})

0 comments on commit 2d910d7

Please sign in to comment.