tests/testthat/test_merge.R

context("Testing the merge_intervals() function.")

test_that("merge_intervals merges in the middle.", {
  expect_equal(merge_intervals(i = 3, ni = c(1, 5, 10, 20, 28)), c(1, 5, 20, 28))
})

test_that("merge_intervals merges the first interval.", {
  expect_equal(merge_intervals(2, c(1, 5, 10, 20)), c(1, 10, 20))
})

test_that("merge_intervals merges the second-to-last interval.", {
  expect_equal(merge_intervals(3, c(1, 5, 10, 20)), c(1, 5, 20))
})

Try the rLakeAnalyzer package in your browser

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

rLakeAnalyzer documentation built on June 10, 2019, 1:02 a.m.