-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
diamond: Add diamond exercise #408
Conversation
Thanks. We should discuss whether the tests should be example-based/value-based (as they are currently written) or property-based as the README and |
Asking at exercism/problem-specifications#191 tells me that it is preferred that we test specific properties of the solutions, rather than the exact values - to show a different way of testing, since all other problems are going to be using example-based tests. Do you think it will be possible to implement the property-based tests in this language? Obviously the example.go can stay the same! |
@petertseng I hadn't know about property-based testing before but after some reading about it, seems superior. Thanks for pushing in this direction! |
Nicely done, I'm glad this worked out! In fact I will have to explore |
@@ -76,7 +76,8 @@ | |||
"connect", | |||
"ledger", | |||
"poker", | |||
"variable-length-quantity" | |||
"variable-length-quantity", | |||
"diamond" |
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.
any thoughts on moving this up earlier to get the exposure a bit earlier? I'm only blindly guessing at the difficulty, but it seems once someone understands how to work with the tests it the task itself can be less complex than, say, connect
and poker
. What about moving it before, say, react
?
We don't have to worry too much about getting the order exactly right though - we'll have a better idea of the order when #345 is complete. But let's try to make a guess now and we can adjustg later
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.
Done, put before react
.
Everything looks good and it looks like the tests chosen were exactly the ones in the README. So I think after we decide on a location to place this problem, this will be ready to merge. If you have time to discuss some things not related to this PR in particular, but tangentially related to it: I haven't solved this exercise myself yet in any other language, and I think we are one of the early tracks to do this property-based testing (others are using example-based except C# and F#) Did you feel the sequence of tests in the README was logical? Does it allow incremental progress toward a solution? Was there any test that will always pass with no additional effort if the previous ones have been taken care of? I do know that https://github.com/exercism/xfsharp/blob/master/exercises/diamond/DiamondTest.fs and https://github.com/exercism/xcsharp/blob/master/exercises/diamond/DiamondTest.cs chose a slightly different order from us, but different things may make sense for different tracks. Any feedback you have can help us improve the README. |
Here's a question, let me know if I missed something - is there something that makes sure that the diamond extends to the correct letter? For example, that if I ask for |
Ah, indeed, if I make the function always return "A\n" as long as the byte is in-range, all the tests do pass. So I guess we should add some test that checks that we go to the right letters. |
@petertseng Thanks for catching this mistake. I changed |
Thanks! Can you change all the "Remore" to "Remove"? Too bad about the
I wish there were an indication shown here that there have some tests that were skipped. using If we can't make things work out, I suppose we could switch to using |
I removed skips at all because Also, removed main function since it was actually unnecessary. |
@petertseng Let me know what else is needed. Otherwise, I will rebase and squash commits for merge. |
I think we're ready to get this merged! Would you rebase and squash? |
* property-based tests
870f98e
to
8319b38
Compare
@kytrinyx Rebased and squashed. Good to go! |
Thanks! Nicely done! |
No description provided.