tests/testthat/test-correspondence.R

context("correspondence between bcal and pcal")

test_that("correspondence test 1", {
  expect_equal(
    pcal(.1),
    bfactor_to_prob(bcal(.1))
  )
})

test_that("correspondence test 2", {
  expect_equal(
    pcal(seq(0, 1, .05)),
    bfactor_to_prob(bcal(seq(0, 1, .05)))
  )
})

test_that("correspondence test 3", {
  expect_equal(
    pcal(seq(0, 1, .05), seq(1, 0, -.05)),
    bfactor_to_prob(bcal(seq(0, 1, .05)), seq(1, 0, -.05))
  )
})

test_that("correspondence test 4", {
  expect_equal(
    pcal(.1, seq(1, 0, -.05)),
    bfactor_to_prob(bcal(.1), seq(1, 0, -.05))
  )
})
pedro-teles-fonseca/pcal documentation built on Nov. 4, 2022, 3:01 p.m.