Audit test files for assert/refute with no custom message
These should have a custom message put in place as without them you get a very unhelpful message like this:
Failed assertion, no message given.
exercism/x-common#230 talks about this, Let's open an issue on x-common for any that need them.
And for the non-generated ones, l think we could make a check listed note here and do PR's against the list?
Where they're generated, we can generate the custom message based on the inputs/outputs. The few times that we've had messages in the test data it's just been echoing the inputs, and it hasn't added any value.
If we can do a good job of it, I say go for it. Writing good error messages can be hard, just about as hard as naming things, and they are more important, because if they are there, they are intended to hold your hand a little bit, and definitely should not misinform. I would rather have a non-informative error message than a misleading one.
Currently these files still have this style of test:
- [ ] exercises/allergies/allergies_test.rb
- [ ] exercises/bracket-push/bracket_push_test.rb
- [ ] exercises/clock/clock_test.rb
- [ ] exercises/custom-set/custom_set_test.rb
- [ ] exercises/grade-school/grade_school_test.rb
- [ ] exercises/isogram/isogram_test.rb
- [ ] exercises/leap/example.tt
- [ ] exercises/leap/leap_test.rb
- [ ] exercises/luhn/luhn_test.rb
- [ ] exercises/pangram/pangram_test.rb
- [ ] exercises/pythagorean-triplet/pythagorean_triplet_test.rb
- [ ] exercises/queen-attack/queen_attack_test.rb
- [ ] exercises/triangle/triangle_test.rb
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'd rather see effort put into created canonical data and converting exercises to using generators than into crafting error messages for non-generated test suites.
I wonder if @hilary comment will cause the Probot to now leave this open...
I'd rather see effort put into created canonical data and converting exercises to using generators than into crafting error messages for non-generated test suites.
However, the generators should still be generating asserts with sensible failure messages, and we will need to check for this at some point.
I would far rather see good error messages in the canonical data than generated messages for assert/refute, as I have yet to find generated assert/refute messages useful.
If they're doing red/green, they're looking at the tests anyway... but hey, if someone wants to put the effort into adding generated messages for assert/refute, I realize that meaningful error messages in the canonical data is ... unlikely.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still relevant
I think this can be closed now due to #1393 being merged.
I wonder if that gave some Hacktoberfest credit for this year!
I doubt it. Also I don't participate in hacktoberfest :)
I think if anyone got points for it, it would have been Cohen.
I think that would be a most excellent outcome!