ddtRunSingle: Run single test under given location

Description Usage Arguments See Also Examples

View source: R/ddtRunSingle.R

Description

Run single test under given location

Usage

1
2
ddtRunSingle(ddtDir, preload, compare, expectedFileName = "data.txt",
  readSaveObj = NULL)

Arguments

ddtDir

(characters) path where tests inputs and outputs should be stored

preload

(function) loading function

compare

(function) compared of actual and expected objects

expectedFileName

(character) generated file

readSaveObj

(list of functions )

See Also

ddtRun getReadSaveObj

Other ddtRun: ddtRun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ddtDir <- './tests/example_in_doc/testCase_1'  #location where single DDT is
x <- 1:20
y <- x*2 + rnorm(20)
preload <- function(){ return(lm(y~x)) }
compare <- function(expected, actual){
 if(all(abs(expected$coefficients - actual$coefficients) < 0.001) ){
   print("Same")
 } else {
   stop("wrong coefficents. Expected ", expected$coefficients, " but is ",  actual$coefficients)
 }}
# ddtRunSingle(ddtDir, preload, compare) # will create required files

bnbsystems/ddt documentation built on May 24, 2019, 3:04 a.m.