summaryrefslogtreecommitdiff
path: root/internal/validate/formvalidation_test.go
diff options
context:
space:
mode:
authorLibravatar Blake Smith <blakesmith0@gmail.com>2024-03-15 05:36:43 -0500
committerLibravatar GitHub <noreply@github.com>2024-03-15 11:36:43 +0100
commit15578835a87de195113f6cc9295f05a6c175a811 (patch)
tree1cdb38a20379ce98546e88ee4863980fa921fa3b /internal/validate/formvalidation_test.go
parent[chore] Swagger: correct names and formats for several array params (#2758) (diff)
downloadgotosocial-15578835a87de195113f6cc9295f05a6c175a811.tar.xz
[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: https://github.com/golang/go/commit/263c059b09fdd40d9dd945f2ecb20c89ea28efe5
Diffstat (limited to 'internal/validate/formvalidation_test.go')
-rw-r--r--internal/validate/formvalidation_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/validate/formvalidation_test.go b/internal/validate/formvalidation_test.go
index 578b300ea..7c1ff7b7f 100644
--- a/internal/validate/formvalidation_test.go
+++ b/internal/validate/formvalidation_test.go
@@ -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)