tests/testthat/test_arma_headers.R

context("Testing arma headers")

test_that("btb::arma::quantile gives right quantiles", {
    
    for (i in seq.int(5)) {
        expect_true(
            .unit_test_arm_quantile(10, 1e-8)
        )
    }
    
})

test_that("btb::arma::softmax & log_softmax normalizes correctly", {
    
    for (i in seq.int(5)) {
        expect_true(
            .unit_test_arm_softmax(20, 1e-8)
        )
    }
    
})

test_that("btb::arma::rmvnom gives right draws", {
    
    for (i in seq.int(5)) {
        expect_true(
            .unit_test_arm_rmvnorm(1e6, 4, 0.005)
        )
    }
    
})

test_that("btb::arma::rmvnom (single draws) gives right draws", {
    
    for (i in seq.int(5)) {
        expect_true(
            .unit_test_arm_rmvnorm_1(1e6, 4, 0.005)
        )
    }
    
})
baruuum/btoolbox documentation built on Aug. 17, 2020, 1:29 a.m.