-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
These two tests break under the current development version of R which is in the process of being released to CRAN:
logrx/tests/testthat/test-get.R
Lines 181 to 189 in f6c24f8
| expected <- paste0( | |
| "Line 6 [library_call_linter] Move all library calls to the ", | |
| "top of the script.\n\nLine 8 [undesirable_operator_linter] Operator ", | |
| "`<<-` is undesirable. It\nassigns outside the current environment in a ", | |
| "way that can be hard to reason\nabout. Prefer fully-encapsulated ", | |
| "functions wherever possible, or, if\nnecessary, assign to a specific ", | |
| "environment with assign(). Recall that you\ncan create an environment ", | |
| "at the desired scope with new.env()." | |
| ) |
logrx/tests/testthat/test-writer.R
Lines 199 to 209 in f6c24f8
| "Line 3 [undesirable_operator_linter] Operator `<<-` is undesirable.", | |
| " It\nassigns outside the current environment in a way that can be hard", | |
| " to reason\nabout. Prefer fully-encapsulated functions wherever possible,", | |
| " or, if\nnecessary, assign to a specific environment with assign(). ", | |
| "Recall that you\ncan create an environment at the desired scope with", | |
| " new.env().\n\nLine 4 [undesirable_operator_linter] Operator `<<-` is", | |
| " undesirable. It\nassigns outside the current environment in a way that", | |
| " can be hard to reason\nabout. Prefer fully-encapsulated functions", | |
| " wherever possible, or, if\nnecessary, assign to a specific environment", | |
| " with assign(). Recall that you\ncan create an environment at the", | |
| " desired scope with new.env()." |
In general, I try and avoid relying on fragile things like "the exact wording of an error message produced by an upstream package".
For example, in {data.table}, we have this list of messages/message factories for test outputs that come directly from {base} R:
I will submit a quick-fix PR shortly, but it's worth thinking through a more robust way to structure these tests going forward.
Session Information
No response
Reproducible Example
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working