tests/testthat/test-stanc.R

test_that("long error messages work", {
  skip("Backwards compatibility")

  code <- "parameters { cov_matrix[3] y; }
           model { y ~ normal(0, 1); }"
  expect_error({r <- stanc(model_code = code)})
  warning_length <- getOption("warning.length")
  emsg <- geterrmessage()
  expect_true(nchar(emsg) < 1000)
  expect_equal(warning_length, getOption("warning.length"))
})

Try the rstan package in your browser

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

rstan documentation built on May 29, 2024, 11:04 a.m.