elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 58 forks source link

Fix #132 #133

Closed pzp1997 closed 4 years ago

pzp1997 commented 4 years ago

This PR addresses the logical error in isInfixOf discovered in #132. I added a unit test to prevent future regressions.

In the process of fixing the bug, I found a second unrelated issue in isPrefixOf that could cause a stack overflow for sufficiently large lists. (Since isSuffixOf and isInfixOf use isPrefixOf as a helper, they are also affected.) I added unit tests to make sure these functions do not cause a stack overflow in the future.

Lastly, I added some fuzz tests for isPrefixOf, isSuffixOf, and isInfixOf.

Chadtech commented 4 years ago

Awesome! Thank you.