testFunction: Test function

View source: R/testFunction.R

testFunctionR Documentation

Test function

Description

Apply data to function signature and record results.

Usage

testFunction(function_f_1,
             generatedData_l,
             functionName_s_1 = deparse(substitute(function_f_1)))

Arguments

function_f_1

a single R function, offensive programming ready, with using semantic argument names

generatedData_l

data to apply to the function. Could be generated by generateData function is desired.

functionName_s_1

A string that is the function name. Particularly useful, in scripts.

Details

Executes code and captures execution context and result, for posterior analysis.

Value

A list with following names

generation argument name generation
data generated data
context data tyep generation context
n number of first level data generated

Generated data are ready for use and accessible using the data name of the list.

See Also

Refer to opwf.

Examples

# typical example
op_sum <- opwf(sum, c('...', 'removeNA_b_1'))
op_sum_atr <- list('...' = c('i', 'd', 'c'))
ec <- setGenerationContext(0, TRUE, FALSE)
gd <- generateData(op_sum, op_sum_atr, ec, erc$hetero_vector[[1]], dac$none)
tf <- testFunction(op_sum, gd$data)

wyz.code.metaTesting documentation built on Sept. 25, 2023, 9:06 a.m.