tests/testthat/test-0-11-m4-negative-controls.R

testthat::test_that("M4 negative controls are deterministic design objects", {
  sim <- simulate_multimodal_m4(n_person = 10L, n_item = 6L, seed = 106L)

  a <- multimodal_m4_negative_controls(sim, seed = 99L, run = FALSE)
  b <- multimodal_m4_negative_controls(sim, seed = 99L, run = FALSE)

  expected <- c(
    "order_shuffle",
    "process_shuffle",
    "state_independent",
    "nuisance_pseudostate",
    "device_session_pseudostate",
    "overfit_state_count"
  )

  testthat::expect_s3_class(
    a,
    "eye_multimodal_m4_negative_controls"
  )

  testthat::expect_false(a$executed)
  testthat::expect_false(b$executed)
  testthat::expect_identical(a$controls, expected)
  testthat::expect_identical(a$controls, b$controls)
  testthat::expect_equal(length(a$controls), 6L)
  testthat::expect_identical(a$data, b$data)
})

Try the eyeprocess package in your browser

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

eyeprocess documentation built on Sept. 28, 2026, 5:08 p.m.