Currently, in if tests, for loops and function definitions, it is not possible to rerun the piece of code that is zoomed in on like it is possible in pythonwhat with has_equal_value(), has_equal_error() and has_equal_output(). It shouldn't be that hard to include this functionality as well. What it would look like:
# check if condition of an if-else evaluates correctly
ex() %>% check_if_else() %>% {
check_cond(.) %>% check_expr() %>% check_result() %>% check_equal()
check_if() %>% ...
check_else() %>% ...
}
# check if value of a variable total is properly updated in the body (where to put "total"?)
ex() %>% check_for_loop() %>% {
check_cond(.) %>% ...
check_body(.) %>% check_expr() %>% check_result("total") %>% check_equal("total")
}
# todo add more ...
cc @sumedh10 if you have any ideas on what a good API would be, let me know.
Currently, in
if
tests,for
loops and function definitions, it is not possible to rerun the piece of code that is zoomed in on like it is possible inpythonwhat
withhas_equal_value()
,has_equal_error()
andhas_equal_output()
. It shouldn't be that hard to include this functionality as well. What it would look like:cc @sumedh10 if you have any ideas on what a good API would be, let me know.