testFunction: Test function

Description Usage Arguments Details Value See Also Examples

View source: R/testFunction.R

Description

Apply data to function signature and record results.

Usage

1
2
3
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 character vector of length 1, holding the function name. This is particularly useful, in scripts.

Details

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

Value

A list with names generation, data, context, and n, representing respectively, argument name generation, data, data type generation context, and the number of data generated at the first level.

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

See Also

Refer to opwf.

Examples

1
2
3
4
5
6
# 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)

neonira/wyz.code.metaTesting documentation built on Feb. 19, 2020, 12:46 p.m.