Skip to content

Commit 257e98c

Browse files
committed
Tweak reference index
1 parent b3f2203 commit 257e98c

37 files changed

+55
-43
lines changed

β€ŽR/expect-comparison.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: is returned value less or greater than specified value?
1+
#' Is a number greater than or less than the expected value?
22
#'
33
#' @inheritParams expect_equal
44
#' @param expected Single numeric value to compare.

β€ŽR/expect-condition.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does code throw an error, warning, message, or other condition?
1+
#' Does code throw an error, warning, message, or other condition?
22
#'
33
#' @description
44
#' `expect_error()`, `expect_warning()`, `expect_message()`, and

β€ŽR/expect-constant.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: is the object true/false?
1+
#' Is an object true/false?
22
#'
33
#' These are fall-back expectations that you can use when none of the other
44
#' more specific expectations apply. The disadvantage is that you may get
@@ -44,7 +44,7 @@ expect_false <- function(object, info = NULL, label = NULL) {
4444
expect_waldo_constant(act, FALSE, info = info)
4545
}
4646

47-
#' Expectation: is an object `NULL`?
47+
#' Is an object `NULL`?
4848
#'
4949
#' This is a special case because `NULL` is a singleton so it's possible
5050
#' check for it either with `expect_equal(x, NULL)` or `expect_type(x, "NULL")`.

β€ŽR/expect-equality.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: is an object equal to a reference value?
1+
#' Is an object equal to the expected value?
22
#'
33
#' @description
44
#' These functions provide two levels of strictness when comparing a
@@ -128,7 +128,7 @@ expect_waldo_equal <- function(type, act, exp, info, ...) {
128128
invisible(act$val)
129129
}
130130

131-
#' Expectation: is an object equal to a reference value, ignoring attributes?
131+
#' Is an object equal to the expected value, ignoring attributes?
132132
#'
133133
#' Compares `object` and `expected` using [all.equal()] and
134134
#' `check.attributes = FALSE`.
@@ -170,7 +170,7 @@ expect_equivalent <- function(object, expected, ..., info = NULL, label = NULL,
170170
}
171171

172172

173-
#' Do two names point to the same underlying object?
173+
#' Does code yield a reference to the expected object?
174174
#'
175175
#' `expect_reference()` compares the underlying memory addresses of
176176
#' two symbols. It is for expert use only.

β€ŽR/expect-inheritance.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does the object inherit from a S3 or S4 class, or is it a base type?
1+
#' Does an object inherit from a S3 or S4 class, or is it a base type?
22
#'
33
#' @description
44
#' See <https://adv-r.hadley.nz/oo.html> for an overview of R's OO systems, and
@@ -103,7 +103,7 @@ expect_s4_class <- function(object, class) {
103103

104104
isS3 <- function(x) is.object(x) && !isS4(x)
105105

106-
#' Expectation: does the object inherit from a given class?
106+
#' Does an object inherit from a given class?
107107
#'
108108
#' @description
109109
#' `r lifecycle::badge("superseded")`

β€ŽR/expect-invisible.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does expression return visibly or invisibly?
1+
#' Does code return visibly or invisibly?
22
#'
33
#' Use this to test whether a function returns a visible or invisible
44
#' output. Typically you'll use this to check that functions called primarily

β€ŽR/expect-length.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does a vector have the specified length?
1+
#' Does a vector have the specified length?
22
#'
33
#' @seealso [expect_vector()] to make assertions about the "size" of a vector
44
#' @inheritParams expect_that

β€ŽR/expect-named.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does object have names?
1+
#' Does a vector have names?
22
#'
33
#' You can either check for the presence of names (leaving `expected`
44
#' blank), specific names (by supplying a vector of names), or absence of

β€ŽR/expect-output.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does code print output to the console?
1+
#' Does code print output to the console?
22
#'
33
#' Test for output produced by `print()` or `cat()`. This is best used for
44
#' very simple output; for more complex cases use [verify_output()].

β€ŽR/expect-setequal.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: do two vectors contain the same values?
1+
#' Does a vector contain the same values as the expected vector?
22
#'
33
#' * `expect_setequal(x, y)` tests that every element of `x` occurs in `y`,
44
#' and that every element of `y` occurs in `x`.

β€ŽR/expect-silent.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: is the code silent?
1+
#' Does code execute silently?
22
#'
33
#' Checks that the code produces no output, messages, or warnings.
44
#'

β€ŽR/expect-vector.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does the object have vctr properties?
1+
#' Does a vector have the specified size and/or prototype?
22
#'
33
#' `expect_vector()` is a thin wrapper around [vctrs::vec_assert()], converting
44
#' the results of that function in to the expectations used by testthat. This

β€ŽR/expectations-matches.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Expectation: does string match a regular expression?
1+
#' Does a string match a regular expression?
22
#'
33
#' @details
44
#' `expect_match()` is a wrapper around [grepl()]. See its documentation for

β€ŽR/old-school.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ matches <- function(regexp, all = TRUE, ...) {
133133
}
134134

135135

136-
#' Expectation: does expression take less than a fixed amount of time to run?
136+
#' Does code take less than the expected amount of time to run?
137137
#'
138138
#' This is useful for performance regression testing.
139139
#'

β€ŽR/test-compiled-code.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ expect_cpp_tests_pass <- function(package) {
2020
expect(tests_passed, paste("C++ unit tests:", info, sep = "\n"))
2121
}
2222

23-
#' Expectation: do C++ tests past?
23+
#' Do C++ tests past?
2424
#'
2525
#' Test compiled code in the package `package`. A call to this function will
2626
#' automatically be generated for you in `tests/testthat/test-cpp.R` after

β€ŽR/verify-output.R

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#' test on your CI platforms that don't support UTF-8 (e.g. Windows).
4444
#' @param env The environment to evaluate `code` in.
4545
#' @export
46+
#' @keywords internal
4647
#' @examples
4748
#' # The first argument would usually be `test_path("informative-name.txt"`)
4849
#' # but that is not permitted in examples

β€Ž_pkgdown.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ reference:
1414
- title: Expectations
1515
contents:
1616
- starts_with("expect_")
17+
- -starts_with("expect_snapshot_")
18+
19+
- title: Snapshot testing
20+
contents:
21+
- starts_with("expect_snapshot_")
22+
- starts_with("snapshot_")
23+
24+
- test: Test helpers
25+
contents:
26+
- is_testing
1727
- skip
18-
- verify_output
28+
- teardown_env
1929

2030
- title: Run tests
2131
contents:
22-
- starts_with("test_")
2332
- starts_with("auto_test")
2433
- describe
34+
- starts_with("test_")
2535
- use_catch
2636

2737
- title: Reporters

β€Žman/comparison-expectations.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/equality-expectations.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_equivalent.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_error.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_invisible.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_is.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_length.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_match.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_named.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_null.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_output.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_reference.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_setequal.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_silent.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/expect_vector.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/inheritance-expectations.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/logical-expectations.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/run_cpp_tests.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/takes_less_than.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/verify_output.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)