tests/testthat/RStanTest/test-add_test.R

context("add_test")

test_that("external C++ code works", {
  n <- sample(1:20, 1)
  x <- rnorm(n)
  y <- rnorm(n)
  expect_equal(add_test(x, y), x + y)
})

Try the rstantools package in your browser

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

rstantools documentation built on July 26, 2023, 5:35 p.m.