scriptests (version 1.0-16)

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

Description

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

Usage

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.

Value

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

Details

Tries to split the lines in file up into blocks with the following structure:
  • commments: lines preceeding the test that begin with > # or that are empty
  • command: line beginning with > and subsequent lines beginning with the continuation char +
  • control: lines following the command that begin with #@
  • output: other lines following the command and before the next comment or command, which are presumed to be output from the command