Skip to content

Commit

Permalink
Fix test errors in #1147
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Jan 25, 2020
1 parent 90d7b1e commit 7544e8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/test-6-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ test_with_dir("unparsable commands are handled correctly", {
expect_error(deps_code(x))
})

test_with_dir("dot symbol is illegal", {
test_with_dir("bad target names", {
skip_on_cran() # CRAN gets whitelist tests only (check time limits).
expect_equal(
sort(deps_code("sqrt(x + y + .)")$name),
Expand All @@ -388,10 +388,10 @@ test_with_dir("dot symbol is illegal", {
expect_false(exists(".", envir = e))
config <- drake_config(plan)
plan <- drake_plan(
. = 1,
.gitignore = 1,
y = 2,
a = sqrt(x + y),
b = subset(complete.cases(.))
b = subset(complete.cases(.gitignore))
)
expect_error(drake_config(plan), "cannot be target names")
})
Expand Down
12 changes: 7 additions & 5 deletions tests/testthat/test-6-plans.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ test_with_dir("plans can start with bad symbols", {
target = c("a'x'", "b'x'", "_a", "a^-.*"),
command = 1)
y <- drake_config(x)
out <- sort(c("a.x.", "b.x.", "X_a", "a...."))
out <- sort(c("a.x_", "b.x_", "X_a", "a..._"))
expect_true(all(out %in% names(y$spec)))
})

Expand Down Expand Up @@ -375,10 +375,10 @@ test_with_dir("spaces in target names are replaced only when appropriate", {
expect_equal(
sort(pl$target),
sort(c(
"a_.b.....x..y.",
"a_.a..x.",
"drake_target_1_.b.....x..y.",
"drake_target_1_.a..x."
"a_.b.....x..y_",
"a_.a..x_",
"drake_target_1_.b.....x..y_",
"drake_target_1_.a..x_"
))
)
})
Expand Down Expand Up @@ -749,6 +749,8 @@ test_with_dir("convert_trailing_dot() (#1147)", {
})

test_with_dir("convert_trailing_dot() in plans (#1147)", {
n <- seq_len(2)
ids <- rlang::syms(as.character(n))
plan <- drake_plan(
numeric_ids = target(
rnorm(n),
Expand Down

0 comments on commit 7544e8a

Please sign in to comment.