GenericMatchers were designed to do deep matches. They do not call sub matchers in a recursive way such that stack overflows cannot occur.
Strictly nested GenericMatchers do also report deep mismatches, yet indirectly nested GenericMatchers (e.g. the ones contained in a Contains or ContainsInOrder) do not. This means that in scenarios with large setup/assert code debugging the mismatch gets really hard.
There should be a way to report deep mismatches, even if the nesting is interrupted by Non-GenericMatchers.
One way could be to reuse the already existing RecursiveMatcher interface.
GenericMatchers
were designed to do deep matches. They do not call sub matchers in a recursive way such that stack overflows cannot occur.Strictly nested
GenericMatchers
do also report deep mismatches, yet indirectly nestedGenericMatchers
(e.g. the ones contained in aContains
orContainsInOrder
) do not. This means that in scenarios with large setup/assert code debugging the mismatch gets really hard.There should be a way to report deep mismatches, even if the nesting is interrupted by Non-
GenericMatchers
.One way could be to reuse the already existing
RecursiveMatcher
interface.