testex-rd-example-helpers: Rd Example Parsing Helpers

testex-rd-example-helpersR Documentation

Rd Example Parsing Helpers

Description

Rd Example Parsing Helpers

Usage

rd_extract_examples(rd)

rd_code_as_string(rd)

split_testonly_as_expr(rd)

split_testonly(rd)

Arguments

rd

An Rd object

Value

The examples section of an Rd object

A formatted Rd example

An interlaced list of expressions, either representing example code or tests. The names of the list are either ⁠\testonly⁠ or RDCODE depending on the originating source of the expression.

A list of Rd tag contents

Functions

  • rd_extract_examples(): Extract examples tag from an Rd file

  • rd_code_as_string(): Convert an Rd example to string

  • split_testonly_as_expr(): Split sections of an example into evaluated example code blocks and code blocks wrapped in ⁠\testonly⁠ Rd_tags, reassigning srcrefs as the example code is split.

  • split_testonly(): Split sections of an example into lists of Rd_tags. Note that srcrefs are split by line number. If a line is split between two sections, it is attributed to the first section. As this is used primarily for giving line numbers to test messages, this is sufficient for providing test failures locations.


testex documentation built on June 22, 2024, 11:14 a.m.