tests/testthat/test-fit-rep.R

test_that('specify default', {
  metaMethod = lcFitRep(mRandom, metric = 'RSS', maximize = FALSE)
  expect_s4_class(metaMethod, 'lcFitRep')
  expect_true(has_lcMethod_args(metaMethod, 'rep'))
})

test_that('specify min', {
  metaMethod = lcFitRepMin(mRandom, metric = 'RSS')
  expect_false(metaMethod$maximize)
})

test_that('specify max', {
  metaMethod = lcFitRepMax(mRandom, metric = 'ASW')
  expect_true(metaMethod$maximize)
})

test_that('fit', {
  metaMethod = lcFitRepMin(mRandom, metric = 'RSS')

  out = capture.output({
    model = latrend(metaMethod, testLongData, verbose = verboseLevels$finest)
  }, type = 'message')

  expect_match(paste0(out, collapse = '\n'), regexp = 'RSS')
})

Try the latrend package in your browser

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

latrend documentation built on March 31, 2023, 5:45 p.m.