parseTranscriptFile: Parse a R transcript file into blocks of commands and output

Description Usage Arguments Details Value Author(s)

Description

Parse a R transcript file into blocks of commands and output.

Usage

1
parseTranscriptFile(file, ignoreUpToRegExpr = NULL, ignoreAfterRegExpr=NULL, subst=NULL)

Arguments

file

The name of the file containing transcripts.

ignoreUpToRegExpr

If non-NULL, discard lines in the file up to and including the line that matches this regular expression.

ignoreAfterRegExpr

If non-NULL, discard lines in the file including and beyond the line that matches this regular expression.

subst

Provides control over whether the string "pacakge:::" is removed from test code. The default value should work.

Details

Tries to split the lines in file up into blocks with the following structure:

Value

A list of commands and their associated (apparent) output. Each element of the list is a list with the following possible components:

comment

A character vector containing the lines that were interpreted as comments

input

A character vector containing the lines that were interpreted as commands

expr

The parsed input (an expression). Will be a character vector containing an error message if the input could not be parsed as an R expression.

control

A character vector containing the lines that were interpreted as control lines

output

A character vector containing the lines that were interpreted as output lines

Author(s)

Tony Plate


scriptests documentation built on May 1, 2019, 6:51 p.m.