tests/testthat/test_check_integrals.R

context("Check integrals")

test_that("Checking check_integrals",{
  
  #Check that for positive values of meancft and meanrr gives TRUE
  expect_true({
    meancft <- 3
    meanrr  <- 4
    check.integrals(meanrr, meancft)
  })
  
  #Check that for negative values of meancft or meanrr an error arises
  expect_warning({
    meancft <- -3
    meanrr  <- 4
    check.integrals(meanrr, meancft)
  })
  
  expect_warning({
    meancft <- 3
    meanrr  <- -4
    check.integrals(meanrr, meancft)
  })
  
  #Check warning 
  expect_warning({
    meancft <- 3
    meanrr  <- 2
    check.integrals(meanrr, meancft)
  })
  
  
})

Try the pifpaf package in your browser

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

pifpaf documentation built on May 1, 2019, 9:11 p.m.