Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expect_equal_to_reference default behavior changed #683

Closed
brodieG opened this issue Nov 15, 2017 · 4 comments
Closed

expect_equal_to_reference default behavior changed #683

brodieG opened this issue Nov 15, 2017 · 4 comments

Comments

@brodieG
Copy link
Contributor

@brodieG brodieG commented Nov 15, 2017

With the transition to expect_known, I think there was a regression introduced with respect to expect_equal_to_reference :

 #' @export
-#' @rdname expect_known_value
+#' @rdname expect_known_output
 #' @usage NULL
-expect_equal_to_reference <- expect_known_value
+expect_equal_to_reference <- function(..., update = FALSE) {
+  expect_known_value(..., update = TRUE)
+}

Should be:

expect_equal_to_reference <- function(..., update = FALSE) {
  expect_known_value(..., update = update)
}

Happy to submit a PR if you want, but it may be easier for you guys to fix. Let me know. For reference, the NEWS entry suggests the change is not intentional:

expect_known_value() replaces expect_equal_to_reference(), which has been soft-deprecated. It gains an update argument defaulting to TRUE. This changes behaviour from the previous version, and soft-deprecated expect_equal_to_reference() gets update = FALSE.

@hadley
Copy link
Member

@hadley hadley commented Nov 15, 2017

Doh. A PR would be great, although it's already been submitted to CRAN 😢

@brodieG
Copy link
Contributor Author

@brodieG brodieG commented Nov 15, 2017

Oh well, will submit PR later this week then. Still have to get my update to unitizer out so that it works with testthat 2.0.

@jimhester
Copy link
Member

@jimhester jimhester commented Mar 29, 2018

closed by #687

@jimhester jimhester closed this Mar 29, 2018
@jrcpulliam
Copy link

@jrcpulliam jrcpulliam commented Dec 13, 2018

This bug seems to have reappeared somewhere along the line. I'm using 2.0.1, just reinstalled from CRAN. testthat::expect_equal_to_reference yields:

function (..., update = FALSE) 
{
    expect_known_value(..., update = TRUE)
}
<bytecode: 0x10d0ebd70>
<environment: namespace:testthat>

I'm switching to expect_known_value() but thought I should flag this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.