-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial support for test cases #664
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great first step. Will test case code and expected results all be stored together in the single chunk? We'll have to think of an interface for including that
trimws() didn't have the whitespace arg until 3.6
The test cases can be arbitrary code, so for now it can be whatever we need it to be. I was originally thinking it would be examples of student submissions but it could be testing code or anything else really that would become part of the exercise data. Now that I've written out the above, I think I'm now leaning more toward |
Got it! Would it be implemented with a |
- is_AsIs() - is_html_tag() - is_html_chr() - is_html_any()
@rossellhayes I just changed the name from |
Adds initial support for test cases, which can be added to a
<exercise-label>-test-cases
chunk. The test cases can be named and split using code sections, e.g.# first test ----
. They are added to the exercise object under thetest_cases
item, which is eitherNULL
or a list of test cases. If there are no code sections, the single test cases will be in an unnamed list, otherwise test cases are named with default namestest_case_NN
whereNN
is a left-zero-padded integer.I've included a manual test in
tests/manual/test-cases.Rmd
Example Rmd code
For now, this initial support only ensures that
-test-cases
chunks are removed from the tutorial presentation and are stored alongside the exercise object. In the future, we hope to expand test case support, but we want to gather some experience with this format and structure first.