testwhat: Easily write submission correctness tests for R exercises
- CRAN: http://cran.r-project.org/web/packages/testwhat/index.html
- GitHub: https://github.com/datacamp/testwhat
> library(testwhat)
バージョン: 4.2.1
関数名 | 概略 |
---|---|
DC_reporter |
DataCamp reporter: 'log' test results |
check_that |
Expectation wrapper |
ex |
Get the main state |
get_solution_code |
Get solution environment (backwards comp) |
get_solution_env |
Get solution environment (backwards compatbility) |
get_student_code |
Get solution environment (backwards comp) |
is_equal |
Check equality of two objects |
is_false |
Check if object is false |
is_gte |
Check >= relation |
is_true |
Check if object is true |
override |
Override the solution code and pd in a state |
s3definitions |
S3 definitions |
set_language |
Specify the language for the automated feedback |
success_msg |
Define the success message |
test_an_object |
Check if the student defined an object, independent of the name |
test_call |
Test whether a student correctly called a function/operator |
test_call_result |
Check the result of a function call/operation |
test_chunk_options |
Test whether the student defined the correct chunk options (R Markdown exercises) |
test_code |
Test the student's code as text |
test_control |
Test if student coded a control statement correctly |
test_correct |
Test things. If it fails, test additional things. |
test_error |
Check whether the student's submission threw an error. |
test_exercise |
Run all tests for an exercise |
test_expression_result |
Check the result, output or errors thrown by an expression |
test_fun_def |
Check whether the student defined a function correctly |
test_ggplot |
Test ggplot call |
test_library_function |
Test whether the library function was called correctly |
test_mc |
Test a multiple choice exercise |
test_object |
Test R object existence and value |
test_or |
Test if one of many test sets pass. |
test_output |
Check whether the student printed something to the console |
test_pipe |
Test whether a student used the pipe operator sufficiently (ggvis and dplyr exercises) |
test_predefined_objects |
Test predefined R objects |
test_props |
Test whether the student used the correct properties (ggvis exercises) |
test_rmd_file |
Test R Markdown file |
test_rmd_group |
Test a single R Markdown file group (R Markdown exercises) |
test_text |
Test inline text and formatting (Markdown) |
test_wd |
Test whether a file exists |
test_yaml_header |
Test yaml header (Markdown) |
testwhat |
Easily write submission correctness tests for DataCamp |
is_false
> is_false(TRUE)
There was 1 failure:
Position Value Cause
1 1 TRUE true
> is_false(FALSE)
FALSE
TRUE
test_text
> # test_text