Closed kevinburkesegment closed 2 months ago
Changing the signature of assert.Regexp
, assert.NotRegexp
(...) with stricter types would break compatibility. At this point detecting usage errors can only be made via a linter like testifylint.
Changing the signature of
assert.Regexp
,assert.NotRegexp
(...) with stricter types would break compatibility. At this point detecting usage errors can only be made via a linter like testifylint.
I agree with you about the compatibility issue if it was changed now, but what about changing the signature for testify v2?
Would it be acceptable?
For record, I noticed by myself the way to solve this in testify is way more complex than I thought
I'm talking about it here
https://github.com/Antonboom/testifylint/issues/81#issuecomment-2060642389
The signature for
assert.Regexp
(and associated methods) is:However, these methods immediately call
matchRegexp
, which is this:Given this - wouldn't it make more sense for the signature to just be
*regexp.Regexp
andstring
? The latter cast would likely help prevent unexpected behavior around thefmt.Sprint
call.