ReactiveX / RxGo

Reactive Extensions for the Go language.
MIT License
4.96k stars 338 forks source link

Add Support for Custom Error Assertion #409

Open edmondop opened 7 months ago

edmondop commented 7 months ago

Today the package provides Assertion helpers for errors of three type:

These assertions are useful, but could be either too broad or too narrow. Having an assertion that is very precise on the error (that returns true to a fully equality comparison) makes tests brittle, having an assertion that matches any error makes it difficult to know that the failure is right one

This PR adds an additional way to match errors through the introduction of ErrorPredicate