Closed andrjohns closed 1 year ago
I've also verified that this fixes the test failure for the prophet
package under 2.31
Does this fix https://github.com/stan-dev/rstan/issues/954?
It's bizarre, I can't replicate the test failures locally under MacOS, Ubuntu, or Windows
Narrowed it down a bit more. The test will fail when run through rcmdcheck()
but not when run through test_file()
Ah, it looks like sourceCpp
-based functions aren't compatible with testthat
, since it modifies include paths: https://stat.ethz.ch/pipermail/r-package-devel/2017q3/001951.html
May have to just remove the test entirely (after testing locally)
it looks like
sourceCpp
-based functions aren't compatible withtestthat
,
I see. Could probably use Catch: https://testthat.r-lib.org/reference/use_catch.html.
Anyway, it works on my local machine.
Part of the
expose_stan_functions_hacks
code was replacing= nullptr
with= 0
, intended for thepstream__ = nullptr
default argument. However this causes a compilation failure under 2.31, since the generated code now includes default template parameters withnullptr
which are then replaced.This PR updates the regex to only replace the
nullptr
if it's followed by a parenthesis - as the function definitions will always generate thepstream__ = nullptr
as the last argument. I've also added a basic test.This will also need to be backported to 2.26