diff --git a/R/testing.R b/R/testing.R index b5db5e23f..2a9cbc9f0 100644 --- a/R/testing.R +++ b/R/testing.R @@ -86,6 +86,8 @@ run_test <- function(hook_name, #' @param expect_success Whether or not an exit code 0 is expected. This can #' be derived from `std_err`, but sometimes, non-empty stderr does not mean #' error, but just a message. +#' @param read_only If `TRUE` and `artifacts` are not `NULL`, then assert that hook +#' did not modify the artifacts. #' @keywords internal run_test_impl <- function(path_executable, path_candidate, diff --git a/man/run_test.Rd b/man/run_test.Rd index fbc8f4388..f6aa2c84a 100644 --- a/man/run_test.Rd +++ b/man/run_test.Rd @@ -14,7 +14,8 @@ run_test( artifacts = NULL, file_transformer = function(files) files, env = character(), - expect_success = is.null(std_err) + expect_success = is.null(std_err), + read_only = FALSE ) } \arguments{ @@ -55,6 +56,9 @@ made.} \item{expect_success}{Whether or not an exit code 0 is expected. This can be derived from \code{std_err}, but sometimes, non-empty stderr does not mean error, but just a message.} + +\item{read_only}{If \code{TRUE} and \code{artifacts} are not \code{NULL}, then assert that hook +did not modify the artifacts.} } \description{ Tests for the executables used as pre-commit hooks via \code{entrypoint} in diff --git a/man/run_test_impl.Rd b/man/run_test_impl.Rd index 534babd0d..e060309b1 100644 --- a/man/run_test_impl.Rd +++ b/man/run_test_impl.Rd @@ -13,7 +13,8 @@ run_test_impl( artifacts, file_transformer, env, - expect_success + expect_success, + read_only ) } \arguments{ @@ -40,6 +41,9 @@ temporary location and the value is the source of the file.} \item{expect_success}{Whether or not an exit code 0 is expected. This can be derived from \code{std_err}, but sometimes, non-empty stderr does not mean error, but just a message.} + +\item{read_only}{If \code{TRUE} and \code{artifacts} are not \code{NULL}, then assert that hook +did not modify the artifacts.} } \description{ Implement a test run