test_function: evaluate Correctness of a function

Description Usage Arguments Value Examples

View source: R/test_function.R

Description

convert each row of a dataframe to a list of arguments.

Usage

1
test_function(test_dat ,studentFUN ,correctFUN)

Arguments

test_dat

A dataframe that contains the test cases, where each row is one test case.

studentFUN

The function to be tested

correctFUN

Function to be tested against

Value

The function returns a list of lists containing the argiuments to be tested on.

Examples

1
2
3
4
5
6
test1 <- function(x,y)x
test2 <- function(x,y) y + x
correct <- function(a,b) a + b
add_data <- list(list(10,20),list(0,-3))
(test_function(add_data, test1, correct))
(test_function(add_data, test2, correct))

oonyambu/stats_102A documentation built on July 21, 2020, 7:28 a.m.