I'd like to add more detailed descriptions to matc...
# kotest-contributors
a
I'd like to add more detailed descriptions to matching collections and strings, here is my first step. WDYT? https://github.com/kotest/kotest/pull/4244
l
I'm thinking that maybe this computation will have significant impact on larger collections. I do like the idea of adding more information to the users tho. With this one can see which part of the collection was a good match
a
I concur on "significant impact on larger collections." So how about • if mismatch is expected, such as
shouldNotStartWith
don't bother computing • don't invoke if
collection.size > N
where N is configurable
and it does match a slightly modified lorem ipsum:
Copy code
val value = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
            val expected = value.substring(5, value.length - 10)
            val partialMatches = findPartialMatchesInString(expected, value, value.length / 2)
            partialMatches.size shouldBe 1
            partialMatches[0].length shouldBe value.length - 15