Closed latot closed 1 year ago
Do you have a reproducible example? E.g. can you share your package with us?
Hi, I included the zip file in the end of the issue when I posted it :)
For the record, for us the easiest is if you share your reproducible example on GitHub, e.g. then we can refer to the code. In any case, I see the same issue with R CMD check
, for which rcmdcheck is merely a wrapper of, so it is definitely not an issue with rcmdcheck.
Hi, @gaborcsardi I know is a wrapper, I usually agree, but in this case, all tests passes with devtools::test()
, also all in the example works, only fails from rcmdcheck::rcmdcheck()
.
I would appreciate if you can tell me to where this would belongs if is not testthat
nor typed
nor devtools
.
Here the example: https://github.com/latot/bugs/tree/rcmdcheck-217
I would appreciate if you can tell me to where this would belongs if is not testthat nor typed nor devtools.
If I remove testthat.R
, and then add another file tests/mytest.R
:
library(bugtyped)
test_assert()
and then run R CMD check
:
* checking tests ...
Running ‘mytest.R’
ERROR
Running the tests in ‘tests/mytest.R’ failed.
Complete output:
>
> library(bugtyped)
> test_assert()
Error: In `test_assert()` at `custom_var <- ...`:
could not find function "cassert"
Execution halted
Actually, even if I just install the package, and then load it and run test_assert()
, I get the same:
❯ library(bugtyped)
❯ test_assert()
Error: In `test_assert()` at `custom_var <- ...`:
could not find function "cassert"
So this happens without testthat, and without rcmdcheck.
I don't know enough of typed to know if this is a bug in typed or you are not using it correctly, but it must be either one or the other.
:O Thx! a new clue!
From the typed
library, that is the way to declare assertions, I have a lot of them! and works pretty good, except this case which I have no idea why it fails, when I tried to get a reprex was also hard, touch one line and works, but seems to be more probable to happens with longer codes...
Thx!
Hi all, this was initially related to https://github.com/moodymudskipper/typed/issues/33.
Actually when we run tests on the sample I send we have this error:
What is weird,
cassert
is a function in the library, I thought this was a error on thetyped
library, until today when I notice this:Using devtools to run the tests actually works, so maybe this is more related to
rcmdcheck
and a bug in some part with env.We can load the library,
cassert
exists, we can use it and all, only fails when we runrcmdcheck::rcmdcheck()
Thx!
bug_typed.zip