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

Weird behavior for check_output_expr() #199

Open
filipsch opened this issue Sep 21, 2018 · 0 comments
Open

Weird behavior for check_output_expr() #199

filipsch opened this issue Sep 21, 2018 · 0 comments
Labels

Comments

@filipsch
Copy link
Contributor

@beccarobins brought some weird behavior of check_output_expr() to my attention related to some exotic R objects. The following local simulation of an exercise fails, while it shouldn't:

pec <- '
library(readr)
co_counties <- read_rds(gzcon(url("https://assets.datacamp.com/production/repositories/2059/datasets/7e54320199c0894a3d517507362a8dc3abf8fcaf/ch3_co_counties.rds")))
'

code <- 'co_counties@proj4string'

library(testwhat)
setup_state(pec = pec, sol_code = sol_code, stu_code = stu_code)

# This doesn't work
ex() %>% check_output_expr(., "co_counties@proj4string")

# This works:
ex() %>% check_output_expr(., "print(co_counties@proj4string)")

It seems that the co_counties object behaves differently whether or not you're using print, and check_output_expr can't handle it:

> co_counties@proj4string
An object of class "CRS"
Slot "projargs":
[1] "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"

> print(co_counties@proj4string)
CRS arguments:
 +proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0

Not sure what's going on.

@filipsch filipsch added the bug label Sep 21, 2018
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

1 participant