tests/testthat/test-gencor.R

library(gencor)

test_that(desc = "gencor$Matrix object is a matrix", {

  expect_equal(class(gencor()$Matrix)[1], "matrix")

})

test_that(desc = "All generated values belongs to interval [-1,1]", {

  expect_true(all((gencor()$Matrix %>% as.vector %>% abs) >= 0 &
                (gencor()$Matrix %>% as.vector %>% abs) <= 1))

})

Try the gencor package in your browser

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

gencor documentation built on Sept. 13, 2022, 5:06 p.m.