Learn R Programming

exampletestr (version 1.3.1)

construct_expect_equal: Construct an expect_equal expression

Description

Construct an expect_equal expression from a character vector containing an expression to be evaluated.

Usage

construct_expect_equal(text_expr)

Arguments

text_expr

A character vector of lines that, when executed produce a single output.

Value

A character vector. The lines of text containing the expect_equal code corresponding to the input, which will help to write the test file based on documentation examples. Remember that this is something that you're intended to fill the gaps in later.

Examples

Run this code
# NOT RUN {
text_expr <- c("sum(1, ", "2)")
cat(paste(text_expr, collapse = "\n"))
construct_expect_equal(text_expr)
cat(paste(construct_expect_equal(text_expr), collapse = "\n"))
# }

Run the code above in your browser using DataLab