The Boutique Suggestions exercise tests currently don’t check whether the max price is included or not.
My code passed despite using < max instead of <= max. I only noticed the bug when reviewing the community solutions. While I recognize it’s not the focus of this excersise, I feel like it’s the kind of gotcha new coders would benefit from being caught. Also, it’s explicitely in the spec to “filter out combinations where the price of the top and bottom exceed the maximum price”, so I feel that should be in the tests somewhere.
Looking at the tests, I would say either line 123 should be updated with maximum_price: 144.47 and the test text changed to “filter accepts combinations up to a combined maximum price”, or a separate similar test should be added for it.
Thoughts, suggestions? I’m happy to provide a PR if someone will approve it. I see it as a value add, since only solutions with an existing bug per spec will be caught out, and all the top community solutions look like they will pass.
Welcome to the forum and thank you for your suggestion!
On Exercism, there are learning exercises and practice exercises. Practice exercises require critical thinking, creativity, and might include tricky corner cases. Those exercises usually should cover corner cases in the test suite.
But Boutique Suggestions is a learning exercise. It’s supposed to be simple, and its test suite should only focus on verifying that the concept introduced by the exercise has been understood and implemented correctly. In this case, it’s list comprehensions, not comparison operators.
Maintaining so many exercises is not easy, and finding all corner cases is not easy either. That’s why for learning exercises, where corner cases don’t affect the learning process for the specific concept, we (the Elixir track maintainer) chose not to care about extensive test coverage. We don’t try to cover all possible cases if they aren’t related to the concept. The more code there is, the harder it is to maintain, even if it’s simple.
It’s different for practice exercises. Those are maintained by the whole community (not just Elixir Exercism folks), and finding corner cases for those is more useful and more likely to be incorporated to the tests.
I hope this helps clarify the state of learning exercises. Please don’t hesitate to ask if you spot more inconsistencies
That’s fair enough. A suppose the putting it all together test handles the general case well enough to make sure the concept is understood even if there might be other bugs that are irrelevent to the learning exercise.