diff --git a/R/testing.R b/R/testing.R index 47a051232..5495d3580 100644 --- a/R/testing.R +++ b/R/testing.R @@ -267,48 +267,6 @@ n_times_faster_bench <- function(i, x1, x2, fun, ..., n, clear) { ) } - -#' Generate a comprehensive collection test cases for comment / insertion -#' interaction -#' Test consist of if / if-else / if-else-if-else cases, paired with various -#' line-break and comment configurations. Used for internal testing. -#' @return -#' The function is called for its side effects, i.e. to write the -#' test cases to *-in.R files that can be tested with [test_collection()]. Note -#' that a few of the test cases are invalid and need to be removed / commented -#' out manually. -#' @keywords internal -generate_test_samples <- function() { - gen <- function(x) { - if (length(x) == 0L) { - "" - } else { - c( - paste0(x[1L], gen(x[-1L])), - paste0(x[1L], " # comment\n", paste(x[-1L], collapse = "")) - ) - } - } - - collapse <- function(x) paste(x, collapse = "\n\n") - - cat( - collapse(gen(c("if", "(", "TRUE", ")", "NULL"))), - file = "tests/testthat/insertion_comment_interaction/just_if-in.R" - ) - cat( - collapse(gen(c("if", "(", "TRUE", ")", "NULL", " else", " NULL"))), - file = "tests/testthat/insertion_comment_interaction/if_else-in.R" - ) - cat( - collapse(gen(c( - "if", "(", "TRUE", ")", "NULL", " else", " if", "(", "FALSE", ")", "NULL", - " else", " NULL" - ))), - file = "tests/testthat/insertion_comment_interaction/if_else_if_else-in.R" - ) -} - #' @include ui-caching.R clear_testthat_cache <- purrr::partial(cache_clear, "testthat", ask = FALSE) activate_testthat_cache <- purrr::partial(cache_activate, "testthat") diff --git a/man/generate_test_samples.Rd b/man/generate_test_samples.Rd deleted file mode 100644 index 40177fc80..000000000 --- a/man/generate_test_samples.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/testing.R -\name{generate_test_samples} -\alias{generate_test_samples} -\title{Generate a comprehensive collection test cases for comment / insertion -interaction -Test consist of if / if-else / if-else-if-else cases, paired with various -line-break and comment configurations. Used for internal testing.} -\usage{ -generate_test_samples() -} -\value{ -The function is called for its side effects, i.e. to write the -test cases to *-in.R files that can be tested with \code{\link[=test_collection]{test_collection()}}. Note -that a few of the test cases are invalid and need to be removed / commented -out manually. -} -\description{ -Generate a comprehensive collection test cases for comment / insertion -interaction -Test consist of if / if-else / if-else-if-else cases, paired with various -line-break and comment configurations. Used for internal testing. -} -\keyword{internal}