tests/testthat/test-reformulas-import.R

## these tests may fail if run a second time in the same session, because of rlang only-report-once-per-session setting
f <- ~ 1 + (1|f)
test_that("deprecation warnings from lme4 formula processing", {
  expect_warning(subbars(f), "has moved")
  expect_warning(nobars(f), "has moved")
  expect_warning(findbars(f), "has moved")
  expect_warning(mkReTrms(findbars(f), fr = data.frame(f = factor(1:10))), "has moved")
  expect_warning(expandDoubleVerts(f), "has moved")
})

test_that("reOnly shims", {
  reo <- reOnly(Reaction ~ 1 + (1|Subject))
  expect_equal(reo, ~(1 | Subject))
})

Try the lme4 package in your browser

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

lme4 documentation built on March 6, 2026, 1:07 a.m.