View source: R/map_tests_stf.R
| nest_expect | R Documentation |
This internal helper takes a list of parsed test blocks (as produced by
nest_test()) and extracts expectation calls from each block using
get_expect(). It then assembles all detected expectations into a
structured data frame that associates each expectation with its
corresponding test label.
nest_expect(x)
x |
A named list of parsed test blocks, typically produced by
|
For each block in x, the function:
calls get_expect() to extract expectation function calls
and their line ranges,
removes blocks with no expectations,
attaches a test label using the block's list name, and
binds all expectation results into a single consolidated data frame.
If no expectations are found in any block, the function returns NULL.
A data.frame in which each row corresponds to an expectation
extracted from the supplied test blocks. Typical columns include:
Name of the expectation function (e.g.,
"expect_equal").
Starting line number of the expectation expression.
Ending line number of the expectation expression.
Label identifying the test block the expectation belongs to.
Returns NULL if no expectations are detected.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.