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.
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. (SinceisSuffixOf
andisInfixOf
useisPrefixOf
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
, andisInfixOf
.