tests/testthat/test-sampstat-missing.R

test_that("readModels returns an empty typed sampstat object when no sampstat-related sections exist", {
  m <- MplusAutomation::readModels(
    target = testthat::test_path("nbh_indirect.out"),
    what = "sampstat",
    quiet = TRUE
  )
  
  expect_true("sampstat" %in% names(m))
  expect_s3_class(m$sampstat, "mplus.sampstat")
  expect_length(m$sampstat, 0L)
})

Try the MplusAutomation package in your browser

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

MplusAutomation documentation built on Nov. 18, 2026, 1:06 a.m.