tests/testthat/test_120_expr_field.R

testthat::context("ExprField class")

testthat::test_that("Initializer works fine", {
  testthat::expect_error(ExprField$new())
  testthat::expect_error(ExprField$new(tabl = "a"))
  testthat::expect_error(ExprField$new(""))
  ExprField$new("a")
})

testthat::test_that("Conversion to string works fine", {
  testthat::expect_equal(ExprField$new("a")$toString(), "a")
  testthat::expect_equal(ExprField$new("a_b")$toString(), "a_b")
  testthat::expect_equal(ExprField$new("a b")$toString(), '"a b"')
})

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.