@@ -267,48 +267,6 @@ n_times_faster_bench <- function(i, x1, x2, fun, ..., n, clear) {
267
267
)
268
268
}
269
269
270
-
271
- # ' Generate a comprehensive collection test cases for comment / insertion
272
- # ' interaction
273
- # ' Test consist of if / if-else / if-else-if-else cases, paired with various
274
- # ' line-break and comment configurations. Used for internal testing.
275
- # ' @return
276
- # ' The function is called for its side effects, i.e. to write the
277
- # ' test cases to *-in.R files that can be tested with [test_collection()]. Note
278
- # ' that a few of the test cases are invalid and need to be removed / commented
279
- # ' out manually.
280
- # ' @keywords internal
281
- generate_test_samples <- function () {
282
- gen <- function (x ) {
283
- if (length(x ) == 0L ) {
284
- " "
285
- } else {
286
- c(
287
- paste0(x [1L ], gen(x [- 1L ])),
288
- paste0(x [1L ], " # comment\n " , paste(x [- 1L ], collapse = " " ))
289
- )
290
- }
291
- }
292
-
293
- collapse <- function (x ) paste(x , collapse = " \n\n " )
294
-
295
- cat(
296
- collapse(gen(c(" if" , " (" , " TRUE" , " )" , " NULL" ))),
297
- file = " tests/testthat/insertion_comment_interaction/just_if-in.R"
298
- )
299
- cat(
300
- collapse(gen(c(" if" , " (" , " TRUE" , " )" , " NULL" , " else" , " NULL" ))),
301
- file = " tests/testthat/insertion_comment_interaction/if_else-in.R"
302
- )
303
- cat(
304
- collapse(gen(c(
305
- " if" , " (" , " TRUE" , " )" , " NULL" , " else" , " if" , " (" , " FALSE" , " )" , " NULL" ,
306
- " else" , " NULL"
307
- ))),
308
- file = " tests/testthat/insertion_comment_interaction/if_else_if_else-in.R"
309
- )
310
- }
311
-
312
270
# ' @include ui-caching.R
313
271
clear_testthat_cache <- purrr :: partial(cache_clear , " testthat" , ask = FALSE )
314
272
activate_testthat_cache <- purrr :: partial(cache_activate , " testthat" )
0 commit comments