almondtools / testrecorder

Create Test Fixtures from Runnable Java Code
http://testrecorder.amygdalum.net/
GNU Lesser General Public License v3.0
51 stars 5 forks source link

Deep Matchers should provide better error messages #78

Closed almondtools closed 6 years ago

almondtools commented 6 years ago

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.