anagram: Make the test suite as flexible as possible#393
anagram: Make the test suite as flexible as possible#393petertseng merged 1 commit intoexercism:masterfrom rbasso:anagram-generalize-test-suite
Conversation
| . toList | ||
| . anagramsFor (fromList subject) | ||
| . fromList | ||
| . map fromList |
There was a problem hiding this comment.
note for my study - this allows either Text or String to be used. Interesting.
There was a problem hiding this comment.
IsList is fantastic. Way more flexible than I imagined. 😄
|
Seems good! I hope the many |
|
I manually verified that this works on also |
|
Hummm...this is a great idea, @petertseng. I was thinking in something similar to solve the problem of having a separated I'll try to think in a way to test multiple solutions on Travis. |
For a while, we are doings things that seem to increase the number of solutions accepted by the test suites:
crypto-squareto stop testing for intermediary functions, and test only for the essential properties of the solution.anagramsFor, because the order is not an essential part of the problem.All of those things where based on the same idea: To allow more diverse solutions.
This seems to be aligned to what was discussed in exercism/discussions#41 and exercism/discussions#44.
Taking this process to the next level, if the essence of the
anagramproblem is to find anagrams, there is no reason to restrict the solutions to work only on Strings and Lists. The following signatures seem equally reasonable:This PR is an experiment on trying to write the most general possible test suite, allowing users to create beautiful solutions using important libraries that are usually not allowed in most of the exercises.
Closes #392.