DeclareDesign / DesignLibrary

Library of Research Designs
https://declaredesign.org/library/
Other
30 stars 3 forks source link

construct_design_code is not working on windows, maybe? #243

Closed jaspercooper closed 5 years ago

jaspercooper commented 5 years ago

These two tests kept failing with devtools::build_win(), couldn't figure out why.

test_that(desc = "construct_design_code works when args_to_fix is not NULL and exclude_args is not NULL",
code = expect_is(get_design_code(binary_iv_designer(args_to_fix = "N")), "character")
)
test_that(desc = "construct_design_code works when args_to_fix is not NULL and exclude_args is NULL",
code = expect_is(get_design_code(two_arm_attrition_designer(args_to_fix = "N")), "character")
)

The error looks like this:

 -- 1. Error: construct_design_code works when args_to_fix is not NULL and exclud
  <text>:1:343: unexpected symbol
  1: e_probs), type_label = c("Always",      "Never", "Complier", "Defier")[type], u_Z = runif(N),      u_Y = rnorm(N) * outcome_sd, Z = (u_Z < assignment_probs[type]),      X = (type == 1) + (type
                                                                                                                                                                                                                                                                                                                                                            ^

Any ideas, @clarabicalho ?

clarabicalho commented 5 years ago

Can't see why the error and can't reproduce it on windows either, but I can look into these the function and tests more carefully. Could you remind me how to access the report generated by devtools::build_win()?

jaspercooper commented 5 years ago

Thanks for checking @clarabicalho! I would have to send you a link, as I'll get an email about the report. But in any case, it's building perfectly fine on Windows here: https://cran.r-project.org/web/checks/check_results_DesignLibrary.html

So I'm going to chalk it up to some weirdness with build_win(). Closing!

clarabicalho commented 5 years ago

Passes because the tests you mentioned were commented out, it seems? I can pencil this for next time we're looking at helpers.R coverage.