test_that("expect_no_na works correctly", { # Should pass expect_silent(mtcars %>% expect_no_na(mpg, hp)) # Should fail bad_data <- mtcars bad_data$mpg[1] <- NA expect_error(bad_data %>% expect_no_na(mpg), "missing value") }) test_that("expect_range works correctly", { # Should pass expect_silent(mtcars %>% expect_range(mpg, min = 10, max = 35)) # Should fail expect_error(mtcars %>% expect_range(mpg, min = 25, max = 30), "outside range") }) test_that("expect_positive works correctly", { # Should pass expect_silent(mtcars %>% expect_positive(wt, qsec)) # Should fail with negative values bad_data <- mtcars bad_data$wt[1] <- -1 expect_error(bad_data %>% expect_positive(wt), "non-positive") })