tests/testthat/test-multcompBoxplot.R

test_that("multcompBoxplot runs without error", {
  # Use simple graph and silence output
  expect_error(
    suppressPlot <- function(...) {
      pdf(NULL)
      on.exit(dev.off())
      multcompBoxplot(breaks ~ tension, data = warpbreaks)
    },
    NA
  )
})

test_that("multcompBoxplot returns a list", {
  pdf(NULL)
  on.exit(dev.off())
  
  res <- multcompBoxplot(breaks ~ tension, data = warpbreaks)
  expect_type(res, "list")
  expect_true("compFn" %in% names(res))
})

test_that("multcompBoxplot returns a list with expected structure", {
  pdf(NULL)
  on.exit(dev.off(), add = TRUE)
  
  res <- multcompBoxplot(breaks ~ tension, data = warpbreaks)
  
  expect_type(res, "list")
  expect_true("compFn" %in% names(res))
  expect_true("boxplot" %in% names(res) || length(res) >= 2)
})

Try the multcompView package in your browser

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

multcompView documentation built on July 29, 2026, 9:07 a.m.