I'd like to test a function that is supposed to output a regular expression, however I wasn't able to find a reasonably accurate way to do this, and I suspect there currently isn't any.
I'm aware that the reason for removal has been explained in #178. A workaround using r1.as_str() == r2.as_str() has been mentioned in both #313 and #364, however this does not appear to handle the cases where the regexes are compiled from the same string while using different options, i.e. has false positives in the context of "do two regexes return the same output for any possible input?".
A method that would not require the user of this library to maintain their own comparison code (i.e. r1.source_and_options_equals(r2)) would be preferable to a mechanism for exposing the compile options (i.e. r1.as_str() == r2.as_str() && r1.case_insensitive() == r2.case_insensitive() && ...).
I'd like to test a function that is supposed to output a regular expression, however I wasn't able to find a reasonably accurate way to do this, and I suspect there currently isn't any.
I'm aware that the reason for removal has been explained in #178. A workaround using
r1.as_str() == r2.as_str()has been mentioned in both #313 and #364, however this does not appear to handle the cases where the regexes are compiled from the same string while using different options, i.e. has false positives in the context of "do two regexes return the same output for any possible input?".A method that would not require the user of this library to maintain their own comparison code (i.e.
r1.source_and_options_equals(r2)) would be preferable to a mechanism for exposing the compile options (i.e.r1.as_str() == r2.as_str() && r1.case_insensitive() == r2.case_insensitive() && ...).