View source: R/test_function.R
test_function | R Documentation |
convert each row of a dataframe to a list of arguments.
test_function(test_dat ,studentFUN ,correctFUN)
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 |
The function returns a list of lists containing the argiuments to be tested on.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.