tests/testthat/test-mverse.R

test_that("Instantiation works with a data frame (mverse).", {
  mydf <- data.frame(col1 = c(1, 2, 3))
  mv <- mverse(mydf)
  expect_equal(attr(mv, "source"), mydf)
})

test_that("Instantiation works with a data frame (create_multiverse).", {
  mydf <- data.frame(col1 = c(1, 2, 3))
  mv <- mverse(mydf)
  expect_equal(attr(mv, "source"), mydf)
})

test_that(
  "Initializing with an object that is not a data frame throws an error.", {
    a_list <- list("a", "b", "c")
    expect_error(mv <- mverse(a_list))
    an_arrary <- c("a", "b", "c")
    expect_error(mv <- mverse(an_array))
  }
)

Try the mverse package in your browser

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

mverse documentation built on June 21, 2025, 5:09 p.m.