-
-
Notifications
You must be signed in to change notification settings - Fork 199
food-chain: Rewrite tests and add working stub solution. #346
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
Conversation
exercises/food-chain/HINTS.md
Outdated
| - Try to make the code readable. | ||
| - Generalize your solution, allowing the lady to swallow other things. | ||
|
|
||
| Take you time. |
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.
"Take your time"
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.
Fixed. 😄
Anything else?
- Use lyrics from `x-common/exercises/food-chain/canonical-data.json`. - Tests all lines, one by one, and then the entire song. - Add stub solution passing the tests. - Patch example solution to work with the new tests.
petertseng
left a comment
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.
strangely(?) I think there is nothing else I would change. Were you expecting more opposition?
Well, you have to keep in mind I haven't done this exercise in any language.
|
Thank you for the review, @petertseng! 😄
A little, considering that this is the first exercise where we test two multi-line string, line by line.
In that case I recommend you to try this one when you get the time. It may seem pointless at first, but I think I learn a few things refactoring it. |
|
I spent a little more time on
I'll start now. |
|
Hmm, here's one thing that caught my eye. The failure message - It may not be clear to the reader that this means "there was a mismatch at line 2", maybe? |
|
Yeah! I know... it is far from good. The problem is that, to compare with a possibly missing line, we need to compare Maybes. I don't know how to customize an error message... I need to learn more about About the line number, we can have it in the data compared, like we did, or in the test description. In the later case, it would create one test case for each line, and that creates a lot of output. I agree that it deserves to be improved, but I still don't know exactly how. 😕 |
x-common/exercises/food-chain/canonical-data.json.This is a first try at solving #301. When we get this right, we may extend the same logic to
beer-songandhouse.There is some magic in the test suite to check the lyrics line by line, but I couldn't find a better way to write it.
The stub solution has the complete lyrics in the most raw form possible, so that the student will be forced to refactor everything from zero.
The previous tests suite had an empty line at the end, but that makes no sense and doesn't match the reference file.