tests/testthat/test_230_expr_with_null.R

testthat::context("Expressions involving NULL")

testthat::test_that("We can test if a field is NULL or NOT NULL", {
  testthat::expect_equal(ExprIsNull$new(ExprField$new("id"))$toString(),
                         "(id IS NULL)")
  testthat::expect_equal(ExprIsNotNull$new(ExprField$new("id"))$toString(),
                         "(id IS NOT NULL)")
})

Try the sqlq package in your browser

Any scripts or data that you put into this service are public.

sqlq documentation built on Sept. 16, 2025, 9:10 a.m.