mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2024-11-10 15:04:17 +00:00
[chore] Different error message for net/mail parsing on go 1.21.8 and above (#2760)
go 1.21.8 fixed some minor issues in net/mail that causes the test suite to fail
for some mail validation cases. Although we're not on go 1.21.8 yet, make the test
forward and backwards compatible.
See: 263c059b09
This commit is contained in:
parent
efbc8151db
commit
15578835a8
1 changed files with 4 additions and 1 deletions
|
@ -144,7 +144,10 @@ func (suite *ValidationTestSuite) TestValidateEmail() {
|
|||
|
||||
err = validate.Email(almostAnEmailAddress)
|
||||
if suite.Error(err) {
|
||||
suite.Equal(errors.New("mail: no angle-addr"), err)
|
||||
suite.True("mail: no angle-addr" == err.Error() ||
|
||||
// golang 1.21.8 fixed some inconsistencies in net/mail which leads
|
||||
// to different error messages.
|
||||
"mail: missing word in phrase: mail: invalid string" == err.Error())
|
||||
}
|
||||
|
||||
err = validate.Email(aWebsite)
|
||||
|
|
Loading…
Reference in a new issue