binregtest: Binary regression test

Description Usage Arguments Value Author(s) See Also Examples

Description

This function compares to parallel implementations of the same function for equality with respect to all (defined) parameter combinations.

Usage

1
binregtest(FUN1, FUN2, ..., PARS = NULL, PAR1 = NULL, PAR2 = NULL, WHICH = sample(1:n), TRYALL = TRUE, COMP = is.all.equal, NAME = "UNNAMED binregtest", VERBOSE = FALSE)

Arguments

FUN1

first function

FUN2

second function

...

common arguments, each specified as a list

PARS

list of common arguments, each specified as a list, helps to use argument names that are used by binregtest itself

PAR1

optional parameters only handed over to FUN1 (default NULL)

PAR2

optional parameters only handed over to FUN2 (default NULL)

WHICH

optional integer vector defining a subset of the possible parameter combinations

TRYALL

FALSE to interrupt testing once an error has been found (default TRUE tests everything)

COMP

function to compare results (default is.all.equal)

NAME

character scalar describing this regression test

VERBOSE

TRUE to verbose all tests (default FALSE)

Value

TRUE if all tests were successful, FALSE otherwise

Author(s)

Jens Oehlschl<e4>gel

See Also

try, is.all.equal

Examples

1
2
3
4
5
6
7
wronglog <- function(x, base=exp(1)){
  if (x>0)
    log(x, base=base)
  else
    NA
}
binregtest(wronglog, log, x=as.list(0:3), base=list(2, exp(1), 10))

regtest documentation built on May 2, 2019, 5:57 a.m.

Related to binregtest in regtest...