tests/testthat/test-methods-sum.R

## This file is part of the IntervalQuestionStat package for R

## Tests for sum() function

test_that("sum works", {
  list <- IntervalList(c(2, 4), c(4, 6))
  expect_equal(sum(list), IntervalData(6, 10))
})

test_that("prod does not work", {
  list <- IntervalList(c(2, 4), c(4, 6))
  expect_error(prod(list))
})

Try the IntervalQuestionStat package in your browser

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

IntervalQuestionStat documentation built on Nov. 1, 2022, 5:06 p.m.