diff --git a/tests/testthat/test-6-analysis.R b/tests/testthat/test-6-analysis.R index 79c547a43..d199735ae 100644 --- a/tests/testthat/test-6-analysis.R +++ b/tests/testthat/test-6-analysis.R @@ -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), @@ -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") }) diff --git a/tests/testthat/test-6-plans.R b/tests/testthat/test-6-plans.R index 63d1942d7..7aa4649b7 100644 --- a/tests/testthat/test-6-plans.R +++ b/tests/testthat/test-6-plans.R @@ -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))) }) @@ -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_" )) ) }) @@ -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),