tests/testthat/test_cpt.R

context("CPT test")
library(dataprocr)
test_that("`cpt` should work for all kinds of data input", {
  expect_equal(
    cpt(
      jsonlite::read_json("data_cpt.json", simplifyVector = TRUE)
    ), 0.9722, tolerance = 1e-4
  )
  expect_equal(is.na(stopwatch(data.frame())), TRUE)
})
psychelzh/dataprocr documentation built on Oct. 12, 2019, 1:50 a.m.