diff --git a/R/describe.R b/R/describe.R index 242bc97bb..d2feb94cd 100644 --- a/R/describe.R +++ b/R/describe.R @@ -26,6 +26,7 @@ #' #' @param description description of the feature #' @param code test code containing the specs +#' @keywords internal #' @export #' @examples #' describe("matrix()", { diff --git a/R/expect-comparison.R b/R/expect-comparison.R index 985c065aa..59de97326 100644 --- a/R/expect-comparison.R +++ b/R/expect-comparison.R @@ -1,4 +1,4 @@ -#' Does code return a number greater/less than the expected value? +#' Do you expect a number bigger or smaller than this? #' #' @inheritParams expect_equal #' @param object,expected A value to compare and its expected bound. diff --git a/R/expect-condition.R b/R/expect-condition.R index b558f8b30..6d698d4ca 100644 --- a/R/expect-condition.R +++ b/R/expect-condition.R @@ -1,4 +1,4 @@ -#' Does code throw an error, warning, message, or other condition? +#' Do you expect an error, warning, message, or other condition? #' #' @description #' `expect_error()`, `expect_warning()`, `expect_message()`, and diff --git a/R/expect-constant.R b/R/expect-constant.R index 04985ce7d..65b0570d5 100644 --- a/R/expect-constant.R +++ b/R/expect-constant.R @@ -1,4 +1,4 @@ -#' Does code return `TRUE` or `FALSE`? +#' Do you expect `TRUE` or `FALSE`? #' #' @description #' These are fall-back expectations that you can use when none of the other @@ -42,7 +42,7 @@ expect_false <- function(object, info = NULL, label = NULL) { expect_waldo_equal_("equal", act, exp, info = info, ignore_attr = TRUE) } -#' Does code return `NULL`? +#' Do you expect `NULL`? #' #' This is a special case because `NULL` is a singleton so it's possible #' check for it either with `expect_equal(x, NULL)` or `expect_type(x, "NULL")`. diff --git a/R/expect-equality.R b/R/expect-equality.R index 399f98f15..61e1b6187 100644 --- a/R/expect-equality.R +++ b/R/expect-equality.R @@ -1,4 +1,4 @@ -#' Does code return the expected value? +#' Do you expect this value? #' #' @description #' These functions provide two levels of strictness when comparing a diff --git a/R/expect-inheritance.R b/R/expect-inheritance.R index 3238fcdc7..2eff09871 100644 --- a/R/expect-inheritance.R +++ b/R/expect-inheritance.R @@ -1,5 +1,4 @@ -#' Does code return an object inheriting from the expected base type, S3 class, -#' or S4 class? +#' Do you expect an S3/S4/R6/S7 object that inherits from this class? #' #' @description #' See for an overview of R's OO systems, and @@ -207,7 +206,7 @@ expect_s7_class <- function(object, class) { pass(act$val) } -#' Does an object inherit from a given class? +#' Do you expect to inherit from this class? #' #' @description #' `r lifecycle::badge("superseded")` diff --git a/R/expect-invisible.R b/R/expect-invisible.R index 4ffdc83bf..e69a89524 100644 --- a/R/expect-invisible.R +++ b/R/expect-invisible.R @@ -1,4 +1,4 @@ -#' Does code return a visible or invisible object? +#' Do you expect the result to be (in)visible? #' #' Use this to test whether a function returns a visible or invisible #' output. Typically you'll use this to check that functions called primarily diff --git a/R/expect-known.R b/R/expect-known.R index 39a37cef7..91523a801 100644 --- a/R/expect-known.R +++ b/R/expect-known.R @@ -1,4 +1,4 @@ -#' Expectations: is the output or the value equal to a known good value? +#' Do you expect the results/output to equal a known value? #' #' For complex printed output and objects, it is often challenging to describe #' exactly what you expect to see. `expect_known_value()` and @@ -113,7 +113,7 @@ compare_file <- function(path, lines, ..., update = TRUE, info = NULL) { pass(NULL) } -#' Expectations: is the output or the value equal to a known good value? +#' Do you expect the output/result to equal a known good value? #' #' `expect_output_file()` behaves identically to [expect_known_output()]. #' diff --git a/R/expect-length.R b/R/expect-length.R index eb34fc927..871082d4f 100644 --- a/R/expect-length.R +++ b/R/expect-length.R @@ -1,4 +1,4 @@ -#' Does code return a vector with the specified length? +#' Do you expect a vector with this length? #' #' @seealso [expect_vector()] to make assertions about the "size" of a vector, #' [expect_shape()] for more general assertions about object "shape". diff --git a/R/expect-match.R b/R/expect-match.R index 4211a4bdb..d20cde158 100644 --- a/R/expect-match.R +++ b/R/expect-match.R @@ -1,4 +1,4 @@ -#' Does a string match a regular expression? +#' Do you expect a string to match this pattern? #' #' @details #' `expect_match()` checks if a character vector matches a regular expression, diff --git a/R/expect-named.R b/R/expect-named.R index d17d00d6c..6518e40da 100644 --- a/R/expect-named.R +++ b/R/expect-named.R @@ -1,4 +1,4 @@ -#' Does code return a vector with (given) names? +#' Do you expect a vector with (these) names? #' #' You can either check for the presence of names (leaving `expected` #' blank), specific names (by supplying a vector of names), or absence of diff --git a/R/expect-no-condition.R b/R/expect-no-condition.R index 4999fd3b8..bd0376a0b 100644 --- a/R/expect-no-condition.R +++ b/R/expect-no-condition.R @@ -1,4 +1,4 @@ -#' Does code run without error, warning, message, or other condition? +#' Do you expect the absence of errors, warnings, messages, or other conditions? #' #' @description #' These expectations are the opposite of [expect_error()], diff --git a/R/expect-output.R b/R/expect-output.R index 7b1f4c624..9605e54f2 100644 --- a/R/expect-output.R +++ b/R/expect-output.R @@ -1,4 +1,4 @@ -#' Does code print output to the console? +#' Do you expect printed output to match this pattern? #' #' Test for output produced by `print()` or `cat()`. This is best used for #' very simple output; for more complex cases use [expect_snapshot()]. diff --git a/R/expect-reference.R b/R/expect-reference.R index b6759c9e3..e325085c4 100644 --- a/R/expect-reference.R +++ b/R/expect-reference.R @@ -1,4 +1,4 @@ -#' Does code return a reference to the expected object? +#' Do you expect a reference to this object? #' #' `expect_reference()` compares the underlying memory addresses of #' two symbols. It is for expert use only. diff --git a/R/expect-self-test.R b/R/expect-self-test.R index 6a1a94014..bddf26646 100644 --- a/R/expect-self-test.R +++ b/R/expect-self-test.R @@ -28,7 +28,7 @@ capture_success_failure <- function(expr) { ) } -#' Tools for testing expectations +#' Test your custom expectations #' #' @description #' `expect_success()` checks that there's exactly one success and no failures; diff --git a/R/expect-setequal.R b/R/expect-setequal.R index f13c3ab9b..095b43419 100644 --- a/R/expect-setequal.R +++ b/R/expect-setequal.R @@ -1,4 +1,4 @@ -#' Does code return a vector containing the expected values? +#' Do you expect a vector containing these values? #' #' * `expect_setequal(x, y)` tests that every element of `x` occurs in `y`, #' and that every element of `y` occurs in `x`. diff --git a/R/expect-shape.R b/R/expect-shape.R index 7746e9d22..af0e6c45b 100644 --- a/R/expect-shape.R +++ b/R/expect-shape.R @@ -1,4 +1,4 @@ -#' Does code return an object with the specified shape? +#' Do you expect an object with this shape? #' #' This is a generalization of [expect_length()] to test the "shape" of #' more general objects like data.frames, matrices, and arrays. diff --git a/R/expect-silent.R b/R/expect-silent.R index bc7401258..0d409cf96 100644 --- a/R/expect-silent.R +++ b/R/expect-silent.R @@ -1,4 +1,4 @@ -#' Does code execute silently? +#' Do you expect code to execute silently? #' #' Checks that the code produces no output, messages, or warnings. #' diff --git a/R/expect-that.R b/R/expect-that.R index 76d452d5d..3f48dde2f 100644 --- a/R/expect-that.R +++ b/R/expect-that.R @@ -1,4 +1,4 @@ -#' `pass()` or `fail()` a test +#' Declare that an expectation either passes or fails #' #' @description #' These are the primitives that you can use to implement your own expectations. diff --git a/R/expect-vector.R b/R/expect-vector.R index 42fe0a212..bcd4b5ed1 100644 --- a/R/expect-vector.R +++ b/R/expect-vector.R @@ -1,4 +1,4 @@ -#' Does code return a vector with the expected size and/or prototype? +#' Do you expect a vector with this size and/or prototype? #' #' `expect_vector()` is a thin wrapper around [vctrs::vec_assert()], converting #' the results of that function in to the expectations used by testthat. This diff --git a/R/local.R b/R/local.R index ffb492ef5..eaa2a6411 100644 --- a/R/local.R +++ b/R/local.R @@ -1,4 +1,4 @@ -#' Locally set options for maximal test reproducibility +#' Temporarily set options for maximum reproducibility #' #' @description #' `local_test_context()` is run automatically by `test_that()` but you may diff --git a/R/mock2.R b/R/mock2.R index 6a1c0c78d..1939b6fe5 100644 --- a/R/mock2.R +++ b/R/mock2.R @@ -1,4 +1,4 @@ -#' Mocking tools +#' Temporarily redefine function definitions #' #' @description #' `with_mocked_bindings()` and `local_mocked_bindings()` provide tools for diff --git a/R/reporter-check.R b/R/reporter-check.R index da7fdfdb2..7772647a6 100644 --- a/R/reporter-check.R +++ b/R/reporter-check.R @@ -1,4 +1,4 @@ -#' Check reporter: 13 line summary of problems +#' Report results for `R CMD check` #' #' `R CMD check` displays only the last 13 lines of the result, so this #' report is designed to ensure that you see something useful there. diff --git a/R/reporter-debug.R b/R/reporter-debug.R index 4654d193b..49e54fe06 100644 --- a/R/reporter-debug.R +++ b/R/reporter-debug.R @@ -1,4 +1,4 @@ -#' Test reporter: start recovery. +#' Interactively debug failing tests #' #' This reporter will call a modified version of [recover()] on all #' broken expectations. diff --git a/R/reporter-fail.R b/R/reporter-fail.R index 184f0c165..2649a85a7 100644 --- a/R/reporter-fail.R +++ b/R/reporter-fail.R @@ -1,4 +1,4 @@ -#' Test reporter: fail at end. +#' Fail if any tests fail #' #' This reporter will simply throw an error if any of the tests failed. It is #' best combined with another reporter, such as the diff --git a/R/reporter-junit.R b/R/reporter-junit.R index 0c6eb841b..acb28adbb 100644 --- a/R/reporter-junit.R +++ b/R/reporter-junit.R @@ -5,7 +5,7 @@ classnameOK <- function(text) { } -#' Test reporter: summary of errors in jUnit XML format. +#' Report results in jUnit XML format #' #' This reporter includes detailed results about each test and summaries, #' written to a file (or stdout) in jUnit XML format. This can be read by diff --git a/R/reporter-list.R b/R/reporter-list.R index f44363a5b..f02214a0d 100644 --- a/R/reporter-list.R +++ b/R/reporter-list.R @@ -1,7 +1,6 @@ methods::setOldClass("proc_time") -#' List reporter: gather all test results along with elapsed time and -#' file information. +#' Capture test results and metadata #' #' This reporter gathers all results, adding additional information such as #' test elapsed time, and test filename if available. Very useful for reporting. diff --git a/R/reporter-minimal.R b/R/reporter-minimal.R index f8f038d6c..2c6660de4 100644 --- a/R/reporter-minimal.R +++ b/R/reporter-minimal.R @@ -1,4 +1,4 @@ -#' Test reporter: minimal. +#' Report minimal results as compactly as possible #' #' The minimal test reporter provides the absolutely minimum amount of #' information: whether each expectation has succeeded, failed or experienced diff --git a/R/reporter-multi.R b/R/reporter-multi.R index 07157e29d..0a49f3e39 100644 --- a/R/reporter-multi.R +++ b/R/reporter-multi.R @@ -1,4 +1,4 @@ -#' Multi reporter: combine several reporters in one. +#' Run multiple reporters at the same time #' #' This reporter is useful to use several reporters at the same time, e.g. #' adding a custom reporter without removing the current one. diff --git a/R/reporter-progress.R b/R/reporter-progress.R index 25faf9d10..d7c273079 100644 --- a/R/reporter-progress.R +++ b/R/reporter-progress.R @@ -1,4 +1,4 @@ -#' Test reporter: interactive progress bar of errors. +#' Report progress interactively #' #' @description #' `ProgressReporter` is designed for interactive use. Its goal is to diff --git a/R/reporter-rstudio.R b/R/reporter-rstudio.R index 280eff11c..2aaa5bc5f 100644 --- a/R/reporter-rstudio.R +++ b/R/reporter-rstudio.R @@ -1,4 +1,4 @@ -#' Test reporter: RStudio +#' Report results to RStudio #' #' This reporter is designed for output to RStudio. It produces results in #' any easily parsed form. diff --git a/R/reporter-silent.R b/R/reporter-silent.R index add175acc..58b55d228 100644 --- a/R/reporter-silent.R +++ b/R/reporter-silent.R @@ -1,9 +1,8 @@ -#' Test reporter: gather all errors silently. +#' Silently collect and all expectations #' #' This reporter quietly runs all tests, simply gathering all expectations. #' This is helpful for programmatically inspecting errors after a test run. -#' You can retrieve the results with the `expectations()` -#' method. +#' You can retrieve the results with `$expectations()`. #' #' @export #' @family reporters diff --git a/R/reporter-slow.R b/R/reporter-slow.R index 26ea10c6a..bd228d274 100644 --- a/R/reporter-slow.R +++ b/R/reporter-slow.R @@ -1,4 +1,4 @@ -#' Test reporter: show timings for slow tests +#' Find slow tests #' #' @description #' `SlowReporter` is designed to identify slow tests. It reports the diff --git a/R/reporter-stop.R b/R/reporter-stop.R index 84f6daad9..b24500eaa 100644 --- a/R/reporter-stop.R +++ b/R/reporter-stop.R @@ -1,5 +1,6 @@ -#' Test reporter: stop on error +#' Error if any test fails #' +#' @description #' The default reporter used when [expect_that()] is run interactively. #' It responds by [stop()]ping on failures and doing nothing otherwise. This #' will ensure that a failing test will raise an error. diff --git a/R/reporter-summary.R b/R/reporter-summary.R index ff2c28f66..6d07dbfc6 100644 --- a/R/reporter-summary.R +++ b/R/reporter-summary.R @@ -1,12 +1,12 @@ -#' Test reporter: summary of errors. +#' Report a summary of failures #' -#' This is a reporter designed for interactive usage: it lets you know which -#' tests have run successfully and as well as fully reporting information about +#' @description +#' This is designed for interactive usage: it lets you know which tests have +#' run successfully and as well as fully reporting information about #' failures and errors. #' #' You can use the `max_reports` field to control the maximum number -#' of detailed reports produced by this reporter. This is useful when running -#' with [auto_test()] +#' of detailed reports produced by this reporter. #' #' As an additional benefit, this reporter will praise you from time-to-time #' if all your tests pass. diff --git a/R/reporter-tap.R b/R/reporter-tap.R index 3e856a2bb..22845e4e3 100644 --- a/R/reporter-tap.R +++ b/R/reporter-tap.R @@ -1,4 +1,4 @@ -#' Test reporter: TAP format. +#' Report results in TAP format #' #' This reporter will output results in the Test Anything Protocol (TAP), #' a simple text-based interface between testing modules in a test harness. diff --git a/R/reporter-teamcity.R b/R/reporter-teamcity.R index 39e0a7840..d14bdae60 100644 --- a/R/reporter-teamcity.R +++ b/R/reporter-teamcity.R @@ -1,4 +1,4 @@ -#' Test reporter: Teamcity format. +#' Report results in Teamcity format #' #' This reporter will output results in the Teamcity message format. #' For more information about Teamcity messages, see diff --git a/R/skip.R b/R/skip.R index 3903a1c1d..82871943e 100644 --- a/R/skip.R +++ b/R/skip.R @@ -1,4 +1,4 @@ -#' Skip a test +#' Skip a test for various reasons #' #' @description #' `skip_if()` and `skip_if_not()` allow you to skip tests, immediately diff --git a/R/snapshot-file.R b/R/snapshot-file.R index 001033942..056d0e5e2 100644 --- a/R/snapshot-file.R +++ b/R/snapshot-file.R @@ -1,4 +1,4 @@ -#' Snapshot testing for whole files +#' Do you expect this code to create the same file as last time? #' #' @description #' Whole file snapshot testing is designed for testing objects that don't have diff --git a/R/snapshot-manage.R b/R/snapshot-manage.R index aabbefdce..a7949e9ae 100644 --- a/R/snapshot-manage.R +++ b/R/snapshot-manage.R @@ -1,4 +1,4 @@ -#' Snapshot management +#' Accept or reject modified snapshots #' #' * `snapshot_accept()` accepts all modified snapshots. #' * `snapshot_review()` opens a Shiny app that shows a visual diff of each diff --git a/R/snapshot-value.R b/R/snapshot-value.R index bdb834118..0e0864219 100644 --- a/R/snapshot-value.R +++ b/R/snapshot-value.R @@ -1,4 +1,4 @@ -#' Snapshot testing for values +#' Do you expect this code to return the same value as last time? #' #' Captures the result of function, flexibly serializing it into a text #' representation that's stored in a snapshot file. See [expect_snapshot()] diff --git a/R/snapshot.R b/R/snapshot.R index e96167ccb..40f39b547 100644 --- a/R/snapshot.R +++ b/R/snapshot.R @@ -1,4 +1,4 @@ -#' Snapshot testing +#' Do you expect this code to run the same way as last time? #' #' @description #' Snapshot tests (aka golden tests) are similar to unit tests except that the diff --git a/R/test-compiled-code.R b/R/test-compiled-code.R index 149da18f3..6e1ee902d 100644 --- a/R/test-compiled-code.R +++ b/R/test-compiled-code.R @@ -170,7 +170,7 @@ run_cpp_tests <- function(package) { } } -#' Use Catch for C++ Unit Testing +#' Use Catch for C++ unit testing #' #' Add the necessary infrastructure to enable C++ unit testing #' in \R packages with [Catch](https://github.com/catchorg/Catch2) and diff --git a/R/test-state.R b/R/test-state.R index 1721f2485..ff1320314 100644 --- a/R/test-state.R +++ b/R/test-state.R @@ -1,4 +1,4 @@ -#' State inspected +#' Check for global state changes #' #' @description #' One of the most pernicious challenges to debug is when a test runs fine diff --git a/R/try-again.R b/R/try-again.R index 15ed0d852..977b166ab 100644 --- a/R/try-again.R +++ b/R/try-again.R @@ -1,4 +1,4 @@ -#' Try evaluating an expressing multiple times until it succeeds +#' Evaluate an expression multiple times until it succeeds #' #' If you have a flaky test, you can use `try_again()` to run it a few times #' until it succeeds. In most cases, you are better fixing the underlying diff --git a/_pkgdown.yml b/_pkgdown.yml index a1c65c381..7287956da 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -16,38 +16,35 @@ home: href: http://r-pkgs.org/tests.html reference: -- title: Expectations -- subtitle: Objects + +- title: Basics contents: + - test_that - expect_equal - - expect_null - - expect_type + - expect_error + - expect_true -- subtitle: Vectors +- title: Expectations +- subtitle: Values contents: - - expect_length - - expect_shape - expect_gt + - expect_length - expect_match - expect_named + - expect_null - expect_setequal - - expect_true + - expect_shape + - expect_type - expect_vector - subtitle: Side-effects contents: - - expect_error - expect_no_error - expect_invisible - expect_output - expect_silent -- subtitle: Helpers - contents: - - try_again - - local_reproducible_output - -- title: Snapshot testing +- subtitle: Snapshot tests contents: - expect_snapshot - expect_snapshot_value @@ -56,33 +53,35 @@ reference: - title: Test helpers contents: - - local_edition - is_testing + - local_edition + - local_reproducible_output + - set_state_inspector - skip - teardown_env - - set_state_inspector + - try_again - title: Run tests contents: - - describe - - starts_with("test_") + - starts_with("test_") + - -test_that - use_catch -- title: Reporters - contents: - - Reporter - - ends_with("Reporter") - - title: Mocking contents: - with_mocked_bindings - starts_with("mock_") -- title: Expectation internals +- title: Custom expectations contents: - fail - expect_success +- title: Reporters + contents: + - ends_with("Reporter") + - -Reporter + news: releases: - text: "Version 3.2.0" diff --git a/man/CheckReporter.Rd b/man/CheckReporter.Rd index 872f5c213..54f5f5a68 100644 --- a/man/CheckReporter.Rd +++ b/man/CheckReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-check.R \name{CheckReporter} \alias{CheckReporter} -\title{Check reporter: 13 line summary of problems} +\title{Report results for \verb{R CMD check}} \description{ \verb{R CMD check} displays only the last 13 lines of the result, so this report is designed to ensure that you see something useful there. diff --git a/man/DebugReporter.Rd b/man/DebugReporter.Rd index 41693e314..867a352fb 100644 --- a/man/DebugReporter.Rd +++ b/man/DebugReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-debug.R \name{DebugReporter} \alias{DebugReporter} -\title{Test reporter: start recovery.} +\title{Interactively debug failing tests} \description{ This reporter will call a modified version of \code{\link[=recover]{recover()}} on all broken expectations. diff --git a/man/FailReporter.Rd b/man/FailReporter.Rd index 2728512f6..b3547e4fb 100644 --- a/man/FailReporter.Rd +++ b/man/FailReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-fail.R \name{FailReporter} \alias{FailReporter} -\title{Test reporter: fail at end.} +\title{Fail if any tests fail} \description{ This reporter will simply throw an error if any of the tests failed. It is best combined with another reporter, such as the diff --git a/man/JunitReporter.Rd b/man/JunitReporter.Rd index b89164afc..f4880d0bd 100644 --- a/man/JunitReporter.Rd +++ b/man/JunitReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-junit.R \name{JunitReporter} \alias{JunitReporter} -\title{Test reporter: summary of errors in jUnit XML format.} +\title{Report results in jUnit XML format} \description{ This reporter includes detailed results about each test and summaries, written to a file (or stdout) in jUnit XML format. This can be read by diff --git a/man/ListReporter.Rd b/man/ListReporter.Rd index 60c0cd29b..2a4decac6 100644 --- a/man/ListReporter.Rd +++ b/man/ListReporter.Rd @@ -2,8 +2,7 @@ % Please edit documentation in R/reporter-list.R \name{ListReporter} \alias{ListReporter} -\title{List reporter: gather all test results along with elapsed time and -file information.} +\title{Capture test results and metadata} \description{ This reporter gathers all results, adding additional information such as test elapsed time, and test filename if available. Very useful for reporting. diff --git a/man/MinimalReporter.Rd b/man/MinimalReporter.Rd index 26561b621..5f2a341c1 100644 --- a/man/MinimalReporter.Rd +++ b/man/MinimalReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-minimal.R \name{MinimalReporter} \alias{MinimalReporter} -\title{Test reporter: minimal.} +\title{Report minimal results as compactly as possible} \description{ The minimal test reporter provides the absolutely minimum amount of information: whether each expectation has succeeded, failed or experienced diff --git a/man/MultiReporter.Rd b/man/MultiReporter.Rd index f35575b6b..2d413313b 100644 --- a/man/MultiReporter.Rd +++ b/man/MultiReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-multi.R \name{MultiReporter} \alias{MultiReporter} -\title{Multi reporter: combine several reporters in one.} +\title{Run multiple reporters at the same time} \description{ This reporter is useful to use several reporters at the same time, e.g. adding a custom reporter without removing the current one. diff --git a/man/ProgressReporter.Rd b/man/ProgressReporter.Rd index 6a1ba4ba8..07e2a8cb7 100644 --- a/man/ProgressReporter.Rd +++ b/man/ProgressReporter.Rd @@ -4,7 +4,7 @@ \alias{ProgressReporter} \alias{CompactProgressReporter} \alias{ParallelProgressReporter} -\title{Test reporter: interactive progress bar of errors.} +\title{Report progress interactively} \description{ \code{ProgressReporter} is designed for interactive use. Its goal is to give you actionable insights to help you understand the status of your diff --git a/man/RStudioReporter.Rd b/man/RStudioReporter.Rd index 9a8e8ffcf..1814686f9 100644 --- a/man/RStudioReporter.Rd +++ b/man/RStudioReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-rstudio.R \name{RStudioReporter} \alias{RStudioReporter} -\title{Test reporter: RStudio} +\title{Report results to RStudio} \description{ This reporter is designed for output to RStudio. It produces results in any easily parsed form. diff --git a/man/SilentReporter.Rd b/man/SilentReporter.Rd index 5da9f8b82..cba597c66 100644 --- a/man/SilentReporter.Rd +++ b/man/SilentReporter.Rd @@ -2,12 +2,11 @@ % Please edit documentation in R/reporter-silent.R \name{SilentReporter} \alias{SilentReporter} -\title{Test reporter: gather all errors silently.} +\title{Silently collect and all expectations} \description{ This reporter quietly runs all tests, simply gathering all expectations. This is helpful for programmatically inspecting errors after a test run. -You can retrieve the results with the \code{expectations()} -method. +You can retrieve the results with \verb{$expectations()}. } \seealso{ Other reporters: diff --git a/man/SlowReporter.Rd b/man/SlowReporter.Rd index 4897e6e36..678002167 100644 --- a/man/SlowReporter.Rd +++ b/man/SlowReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-slow.R, R/reporter-timing.R \name{SlowReporter} \alias{SlowReporter} -\title{Test reporter: show timings for slow tests} +\title{Find slow tests} \description{ \code{SlowReporter} is designed to identify slow tests. It reports the execution time for each test and can optionally filter out tests that diff --git a/man/StopReporter.Rd b/man/StopReporter.Rd index 3d5850935..f2cee26c4 100644 --- a/man/StopReporter.Rd +++ b/man/StopReporter.Rd @@ -2,13 +2,12 @@ % Please edit documentation in R/reporter-stop.R \name{StopReporter} \alias{StopReporter} -\title{Test reporter: stop on error} +\title{Error if any test fails} \description{ The default reporter used when \code{\link[=expect_that]{expect_that()}} is run interactively. It responds by \code{\link[=stop]{stop()}}ping on failures and doing nothing otherwise. This will ensure that a failing test will raise an error. -} -\details{ + This should be used when doing a quick and dirty test, or during the final automated testing of R CMD check. Otherwise, use a reporter that runs all tests and gives you more context about the problem. diff --git a/man/SummaryReporter.Rd b/man/SummaryReporter.Rd index 0ebbe2e66..d37d28092 100644 --- a/man/SummaryReporter.Rd +++ b/man/SummaryReporter.Rd @@ -2,16 +2,14 @@ % Please edit documentation in R/reporter-summary.R \name{SummaryReporter} \alias{SummaryReporter} -\title{Test reporter: summary of errors.} +\title{Report a summary of failures} \description{ -This is a reporter designed for interactive usage: it lets you know which -tests have run successfully and as well as fully reporting information about +This is designed for interactive usage: it lets you know which tests have +run successfully and as well as fully reporting information about failures and errors. -} -\details{ + You can use the \code{max_reports} field to control the maximum number -of detailed reports produced by this reporter. This is useful when running -with \code{\link[=auto_test]{auto_test()}} +of detailed reports produced by this reporter. As an additional benefit, this reporter will praise you from time-to-time if all your tests pass. diff --git a/man/TapReporter.Rd b/man/TapReporter.Rd index 1ac66f545..013edbf87 100644 --- a/man/TapReporter.Rd +++ b/man/TapReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-tap.R \name{TapReporter} \alias{TapReporter} -\title{Test reporter: TAP format.} +\title{Report results in TAP format} \description{ This reporter will output results in the Test Anything Protocol (TAP), a simple text-based interface between testing modules in a test harness. diff --git a/man/TeamcityReporter.Rd b/man/TeamcityReporter.Rd index 088fcad79..3bcb177f0 100644 --- a/man/TeamcityReporter.Rd +++ b/man/TeamcityReporter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/reporter-teamcity.R \name{TeamcityReporter} \alias{TeamcityReporter} -\title{Test reporter: Teamcity format.} +\title{Report results in Teamcity format} \description{ This reporter will output results in the Teamcity message format. For more information about Teamcity messages, see diff --git a/man/comparison-expectations.Rd b/man/comparison-expectations.Rd index 3a804319a..db5b45a6c 100644 --- a/man/comparison-expectations.Rd +++ b/man/comparison-expectations.Rd @@ -6,7 +6,7 @@ \alias{expect_lte} \alias{expect_gt} \alias{expect_gte} -\title{Does code return a number greater/less than the expected value?} +\title{Do you expect a number bigger or smaller than this?} \usage{ expect_lt(object, expected, label = NULL, expected.label = NULL) @@ -23,7 +23,7 @@ expect_gte(object, expected, label = NULL, expected.label = NULL) use only.} } \description{ -Does code return a number greater/less than the expected value? +Do you expect a number bigger or smaller than this? } \examples{ a <- 9 diff --git a/man/describe.Rd b/man/describe.Rd index cd9119e57..a5433e061 100644 --- a/man/describe.Rd +++ b/man/describe.Rd @@ -69,3 +69,4 @@ describe("math library", { }) }) } +\keyword{internal} diff --git a/man/equality-expectations.Rd b/man/equality-expectations.Rd index 25e6d344f..89877317a 100644 --- a/man/equality-expectations.Rd +++ b/man/equality-expectations.Rd @@ -4,7 +4,7 @@ \alias{equality-expectations} \alias{expect_equal} \alias{expect_identical} -\title{Does code return the expected value?} +\title{Do you expect this value?} \usage{ expect_equal( object, diff --git a/man/expect_error.Rd b/man/expect_error.Rd index 65a1f51b2..a2713f8ce 100644 --- a/man/expect_error.Rd +++ b/man/expect_error.Rd @@ -5,7 +5,7 @@ \alias{expect_warning} \alias{expect_message} \alias{expect_condition} -\title{Does code throw an error, warning, message, or other condition?} +\title{Do you expect an error, warning, message, or other condition?} \usage{ expect_error( object, diff --git a/man/expect_invisible.Rd b/man/expect_invisible.Rd index 18879a153..cfde19525 100644 --- a/man/expect_invisible.Rd +++ b/man/expect_invisible.Rd @@ -3,7 +3,7 @@ \name{expect_invisible} \alias{expect_invisible} \alias{expect_visible} -\title{Does code return a visible or invisible object?} +\title{Do you expect the result to be (in)visible?} \usage{ expect_invisible(call, label = NULL) diff --git a/man/expect_is.Rd b/man/expect_is.Rd index b6892dc6d..d811c9a25 100644 --- a/man/expect_is.Rd +++ b/man/expect_is.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-inheritance.R \name{expect_is} \alias{expect_is} -\title{Does an object inherit from a given class?} +\title{Do you expect to inherit from this class?} \usage{ expect_is(object, class, info = NULL, label = NULL) } diff --git a/man/expect_known_output.Rd b/man/expect_known_output.Rd index bcc959cc3..c19a4483a 100644 --- a/man/expect_known_output.Rd +++ b/man/expect_known_output.Rd @@ -5,7 +5,7 @@ \alias{expect_known_value} \alias{expect_equal_to_reference} \alias{expect_known_hash} -\title{Expectations: is the output or the value equal to a known good value?} +\title{Do you expect the results/output to equal a known value?} \usage{ expect_known_output( object, diff --git a/man/expect_length.Rd b/man/expect_length.Rd index 8168a72f1..f518af9b2 100644 --- a/man/expect_length.Rd +++ b/man/expect_length.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-length.R \name{expect_length} \alias{expect_length} -\title{Does code return a vector with the specified length?} +\title{Do you expect a vector with this length?} \usage{ expect_length(object, n) } @@ -15,7 +15,7 @@ within a function or for loop. See \link{quasi_label} for more details.} \item{n}{Expected length.} } \description{ -Does code return a vector with the specified length? +Do you expect a vector with this length? } \examples{ expect_length(1, 1) diff --git a/man/expect_match.Rd b/man/expect_match.Rd index 5b2d95757..76669bb0d 100644 --- a/man/expect_match.Rd +++ b/man/expect_match.Rd @@ -3,7 +3,7 @@ \name{expect_match} \alias{expect_match} \alias{expect_no_match} -\title{Does a string match a regular expression?} +\title{Do you expect a string to match this pattern?} \usage{ expect_match( object, @@ -60,7 +60,7 @@ alternatives in \link{quasi_label}.} \item{label}{Used to customise failure messages. For expert use only.} } \description{ -Does a string match a regular expression? +Do you expect a string to match this pattern? } \details{ \code{expect_match()} checks if a character vector matches a regular expression, diff --git a/man/expect_named.Rd b/man/expect_named.Rd index f5e879af0..8957ceb6f 100644 --- a/man/expect_named.Rd +++ b/man/expect_named.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-named.R \name{expect_named} \alias{expect_named} -\title{Does code return a vector with (given) names?} +\title{Do you expect a vector with (these) names?} \usage{ expect_named( object, diff --git a/man/expect_no_error.Rd b/man/expect_no_error.Rd index 8110d6dfb..47549a82c 100644 --- a/man/expect_no_error.Rd +++ b/man/expect_no_error.Rd @@ -5,7 +5,7 @@ \alias{expect_no_warning} \alias{expect_no_message} \alias{expect_no_condition} -\title{Does code run without error, warning, message, or other condition?} +\title{Do you expect the absence of errors, warnings, messages, or other conditions?} \usage{ expect_no_error(object, ..., message = NULL, class = NULL) diff --git a/man/expect_null.Rd b/man/expect_null.Rd index 0dc684f4e..acecbd333 100644 --- a/man/expect_null.Rd +++ b/man/expect_null.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-constant.R \name{expect_null} \alias{expect_null} -\title{Does code return \code{NULL}?} +\title{Do you expect \code{NULL}?} \usage{ expect_null(object, info = NULL, label = NULL) } diff --git a/man/expect_output.Rd b/man/expect_output.Rd index 8dd8441d1..8b2b124c1 100644 --- a/man/expect_output.Rd +++ b/man/expect_output.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-output.R \name{expect_output} \alias{expect_output} -\title{Does code print output to the console?} +\title{Do you expect printed output to match this pattern?} \usage{ expect_output( object, diff --git a/man/expect_output_file.Rd b/man/expect_output_file.Rd index a7408a468..b35c40bef 100644 --- a/man/expect_output_file.Rd +++ b/man/expect_output_file.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-known.R \name{expect_output_file} \alias{expect_output_file} -\title{Expectations: is the output or the value equal to a known good value?} +\title{Do you expect the output/result to equal a known good value?} \usage{ expect_output_file( object, diff --git a/man/expect_reference.Rd b/man/expect_reference.Rd index 9adea6a0a..a5841bcb0 100644 --- a/man/expect_reference.Rd +++ b/man/expect_reference.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-reference.R \name{expect_reference} \alias{expect_reference} -\title{Does code return a reference to the expected object?} +\title{Do you expect a reference to this object?} \usage{ expect_reference( object, diff --git a/man/expect_setequal.Rd b/man/expect_setequal.Rd index c6b2b40db..41b823a68 100644 --- a/man/expect_setequal.Rd +++ b/man/expect_setequal.Rd @@ -5,7 +5,7 @@ \alias{expect_mapequal} \alias{expect_contains} \alias{expect_in} -\title{Does code return a vector containing the expected values?} +\title{Do you expect a vector containing these values?} \usage{ expect_setequal(object, expected) diff --git a/man/expect_shape.Rd b/man/expect_shape.Rd index 3a06d0723..84f14a048 100644 --- a/man/expect_shape.Rd +++ b/man/expect_shape.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-shape.R \name{expect_shape} \alias{expect_shape} -\title{Does code return an object with the specified shape?} +\title{Do you expect an object with this shape?} \usage{ expect_shape(object, ..., nrow, ncol, dim) } diff --git a/man/expect_silent.Rd b/man/expect_silent.Rd index bb92152df..a83b4dc13 100644 --- a/man/expect_silent.Rd +++ b/man/expect_silent.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-silent.R \name{expect_silent} \alias{expect_silent} -\title{Does code execute silently?} +\title{Do you expect code to execute silently?} \usage{ expect_silent(object) } diff --git a/man/expect_snapshot.Rd b/man/expect_snapshot.Rd index 5e1b0c332..f6578e415 100644 --- a/man/expect_snapshot.Rd +++ b/man/expect_snapshot.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/snapshot.R \name{expect_snapshot} \alias{expect_snapshot} -\title{Snapshot testing} +\title{Do you expect this code to run the same way as last time?} \usage{ expect_snapshot( x, diff --git a/man/expect_snapshot_file.Rd b/man/expect_snapshot_file.Rd index 23e1556c9..473634109 100644 --- a/man/expect_snapshot_file.Rd +++ b/man/expect_snapshot_file.Rd @@ -5,7 +5,7 @@ \alias{announce_snapshot_file} \alias{compare_file_binary} \alias{compare_file_text} -\title{Snapshot testing for whole files} +\title{Do you expect this code to create the same file as last time?} \usage{ expect_snapshot_file( path, diff --git a/man/expect_snapshot_value.Rd b/man/expect_snapshot_value.Rd index fe913fd93..785f7459e 100644 --- a/man/expect_snapshot_value.Rd +++ b/man/expect_snapshot_value.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/snapshot-value.R \name{expect_snapshot_value} \alias{expect_snapshot_value} -\title{Snapshot testing for values} +\title{Do you expect this code to return the same value as last time?} \usage{ expect_snapshot_value( x, diff --git a/man/expect_success.Rd b/man/expect_success.Rd index 4acc0a435..644a9d9db 100644 --- a/man/expect_success.Rd +++ b/man/expect_success.Rd @@ -5,7 +5,7 @@ \alias{expect_failure} \alias{expect_snapshot_failure} \alias{show_failure} -\title{Tools for testing expectations} +\title{Test your custom expectations} \usage{ expect_success(expr) diff --git a/man/expect_vector.Rd b/man/expect_vector.Rd index cf44af85f..c67323e16 100644 --- a/man/expect_vector.Rd +++ b/man/expect_vector.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/expect-vector.R \name{expect_vector} \alias{expect_vector} -\title{Does code return a vector with the expected size and/or prototype?} +\title{Do you expect a vector with this size and/or prototype?} \usage{ expect_vector(object, ptype = NULL, size = NULL) } diff --git a/man/fail.Rd b/man/fail.Rd index 2650c8002..6bf16f5fc 100644 --- a/man/fail.Rd +++ b/man/fail.Rd @@ -3,7 +3,7 @@ \name{fail} \alias{fail} \alias{pass} -\title{\code{pass()} or \code{fail()} a test} +\title{Declare that an expectation either passes or fails} \usage{ fail( message = "Failure has been forced", diff --git a/man/inheritance-expectations.Rd b/man/inheritance-expectations.Rd index 41ae792de..e2d3d28ee 100644 --- a/man/inheritance-expectations.Rd +++ b/man/inheritance-expectations.Rd @@ -7,8 +7,7 @@ \alias{expect_s4_class} \alias{expect_r6_class} \alias{expect_s7_class} -\title{Does code return an object inheriting from the expected base type, S3 class, -or S4 class?} +\title{Do you expect an S3/S4/R6/S7 object that inherits from this class?} \usage{ expect_type(object, type) diff --git a/man/local_mocked_bindings.Rd b/man/local_mocked_bindings.Rd index ba0d0a004..a12ee90a0 100644 --- a/man/local_mocked_bindings.Rd +++ b/man/local_mocked_bindings.Rd @@ -3,7 +3,7 @@ \name{local_mocked_bindings} \alias{local_mocked_bindings} \alias{with_mocked_bindings} -\title{Mocking tools} +\title{Temporarily redefine function definitions} \usage{ local_mocked_bindings(..., .package = NULL, .env = caller_env()) diff --git a/man/local_test_context.Rd b/man/local_test_context.Rd index 91f53ff4e..8cf9fba1e 100644 --- a/man/local_test_context.Rd +++ b/man/local_test_context.Rd @@ -3,7 +3,7 @@ \name{local_test_context} \alias{local_test_context} \alias{local_reproducible_output} -\title{Locally set options for maximal test reproducibility} +\title{Temporarily set options for maximum reproducibility} \usage{ local_test_context(.env = parent.frame()) diff --git a/man/logical-expectations.Rd b/man/logical-expectations.Rd index 5d75fbfef..e89c62280 100644 --- a/man/logical-expectations.Rd +++ b/man/logical-expectations.Rd @@ -4,7 +4,7 @@ \alias{logical-expectations} \alias{expect_true} \alias{expect_false} -\title{Does code return \code{TRUE} or \code{FALSE}?} +\title{Do you expect \code{TRUE} or \code{FALSE}?} \usage{ expect_true(object, info = NULL, label = NULL) diff --git a/man/set_state_inspector.Rd b/man/set_state_inspector.Rd index b32943a94..08ae0740b 100644 --- a/man/set_state_inspector.Rd +++ b/man/set_state_inspector.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/test-state.R \name{set_state_inspector} \alias{set_state_inspector} -\title{State inspected} +\title{Check for global state changes} \usage{ set_state_inspector(callback) } diff --git a/man/skip.Rd b/man/skip.Rd index b61733f31..9268fbed2 100644 --- a/man/skip.Rd +++ b/man/skip.Rd @@ -14,7 +14,7 @@ \alias{skip_on_covr} \alias{skip_on_bioc} \alias{skip_if_translated} -\title{Skip a test} +\title{Skip a test for various reasons} \usage{ skip(message = "Skipping") diff --git a/man/snapshot_accept.Rd b/man/snapshot_accept.Rd index 71713d459..0e4e6fbc3 100644 --- a/man/snapshot_accept.Rd +++ b/man/snapshot_accept.Rd @@ -3,7 +3,7 @@ \name{snapshot_accept} \alias{snapshot_accept} \alias{snapshot_review} -\title{Snapshot management} +\title{Accept or reject modified snapshots} \usage{ snapshot_accept(files = NULL, path = "tests/testthat") diff --git a/man/try_again.Rd b/man/try_again.Rd index 4af42ccee..2d9d88462 100644 --- a/man/try_again.Rd +++ b/man/try_again.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/try-again.R \name{try_again} \alias{try_again} -\title{Try evaluating an expressing multiple times until it succeeds} +\title{Evaluate an expression multiple times until it succeeds} \usage{ try_again(times, code) } diff --git a/man/use_catch.Rd b/man/use_catch.Rd index 005f965f7..33d7000e6 100644 --- a/man/use_catch.Rd +++ b/man/use_catch.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/test-compiled-code.R \name{use_catch} \alias{use_catch} -\title{Use Catch for C++ Unit Testing} +\title{Use Catch for C++ unit testing} \usage{ use_catch(dir = getwd()) }