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

Add a stricter test for stoppableFoldl behaviour #166

Closed Janiczek closed 1 year ago

Janiczek commented 1 year ago

@adamnfish has found that the tests for List.Extra.stoppableFoldl aren't really testing the main promise of the function: that it will stop running the function after a Stop is returned.

Together we're adding a test which will throw a RangeError (stack overflow) if stoppableFoldl goes through the whole list. We've verified it by temporarily changing the implementation of stoppableFoldl to just be a List.foldl.

Chadtech commented 1 year ago

Nice catch! Thank you.