@@ -7,18 +7,20 @@ unique_tests <- unique(sub("-.*", "", all_examples))
7
7
# tests using 'scope = "spaces"' in test_collection()
8
8
tests_scope_spaces <- " 15"
9
9
10
- warning_map <- c (`23` = ' "issues/1242"' )
10
+ condition_map <- list (`23` = c( " error " , ' "issues/1242"' ) )
11
11
12
12
for (test in unique_tests ) {
13
13
out_file <- file.path(" tests" , " testthat" , paste0(" test-" , roxygen_stub , " -" , test , " .R" ))
14
14
extras <- if (test %in% tests_scope_spaces ) ' , scope = "spaces"' else " "
15
+ condition <- condition_map [[test ]]
16
+ if (is.null(condition )) condition <- c(" warning" , " NA" )
15
17
writeLines(con = out_file , c(
16
18
" # NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R." ,
17
19
" " ,
18
20
sprintf(' test_that("analogous to test-%s: %s", {' , roxygen_stub , test ),
19
21
sprintf(
20
- ' expect_warning (test_collection("%s", "^%s-", transformer = style_text%s), %s)' ,
21
- roxygen_stub , test , extras , warning_map [ test ]
22
+ ' expect_%s (test_collection("%s", "^%s-", transformer = style_text%s), %s)' ,
23
+ condition [ 1L ], roxygen_stub , test , extras , condition [ 2L ]
22
24
),
23
25
" })" ,
24
26
NULL
0 commit comments