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

update unit tests after ggplot2 release #156

Closed
tjmahr opened this issue Jun 1, 2018 · 2 comments
Closed

update unit tests after ggplot2 release #156

tjmahr opened this issue Jun 1, 2018 · 2 comments
Assignees
Labels

Comments

@tjmahr
Copy link
Collaborator

tjmahr commented Jun 1, 2018

The change in ggplot2 to use tidy evaluation means quosures are used inside of ggplot2. Thus, this class of unit tests...

g <- mcmc_intervals(arr, rhat = r)
rhat_map <- g$layers[[3]][["mapping"]]
expect_identical(rhat_map$colour, as.name("rhat_rating"))
#> Error: rhat_map$colour not identical to as.name("rhat_rating").
#> target, current differ in having response: FALSE, FALSE

will fail because the former is a quosure and the latter is a name.

rhat_map$colour
#> <quosure>
#>   expr: ^rhat_rating
#>   env:  000000001DE45EF8
as.name("rhat_rating")
#> rhat_rating

But as far as I can tell, we can get the name with

rlang::get_expr(rhat_map$colour)
expect_identical(rlang::get_expr(rhat_map$colour), as.name("rhat_rating"))

Here are the first batch of errors...

test-mcmc-intervals.R:89: failure: mcmc_intervals/areas with rhat
rhat_map$colour not identical to as.name("rhat_rating").
target, current differ in having response: FALSE, FALSE

test-mcmc-intervals.R:98: failure: mcmc_intervals/areas with rhat
rhat_map2$fill not identical to as.name("rhat_rating").
target, current differ in having response: FALSE, FALSE

test-mcmc-intervals.R:99: failure: mcmc_intervals/areas with rhat
rhat_map2$colour not identical to as.name("rhat_rating").
target, current differ in having response: FALSE, FALSE

test-mcmc-intervals.R:105: failure: mcmc_intervals/areas with rhat
rhat_map4$colour not identical to as.name("rhat_rating").
target, current differ in having response: FALSE, FALSE

test-mcmc-intervals.R:109: failure: mcmc_intervals/areas with rhat
rhat_map5$colour not identical to as.name("rhat_rating").
target, current differ in having response: FALSE, FALSE

== Terminating early =================================================
Too many failures
@jgabry jgabry added the tests label Jun 10, 2018
@tjmahr
Copy link
Collaborator Author

tjmahr commented Sep 12, 2018

Running the tests on a fresh install of R locally and got some errors for missing packages: vdiffr (these are skipped on CRAN, so that's okay), arm and hexbin. I'm just making a note here because in case we need to address these package dependencies on CRAN or travis.

@tjmahr tjmahr self-assigned this Sep 12, 2018
@tjmahr
Copy link
Collaborator Author

tjmahr commented May 3, 2019

The failing tests described above have been fixed.

@tjmahr tjmahr closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants