mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Punycode fixes (#1743)
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
This commit is contained in:
@@ -142,6 +142,36 @@ func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringNoResolve()
|
||||
suite.Len(searchResult.Accounts, 0)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringSpecialChars() {
|
||||
query := "@üser@ëxample.org"
|
||||
resolve := false
|
||||
|
||||
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
if l := len(searchResult.Accounts); l != 1 {
|
||||
suite.FailNow("", "expected %d accounts, got %d", 1, l)
|
||||
}
|
||||
suite.Equal("üser@ëxample.org", searchResult.Accounts[0].Acct)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringSpecialCharsPunycode() {
|
||||
query := "@üser@xn--xample-ova.org"
|
||||
resolve := false
|
||||
|
||||
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
if l := len(searchResult.Accounts); l != 1 {
|
||||
suite.FailNow("", "expected %d accounts, got %d", 1, l)
|
||||
}
|
||||
suite.Equal("üser@ëxample.org", searchResult.Accounts[0].Acct)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchLocalAccountByNamestring() {
|
||||
query := "@the_mighty_zork"
|
||||
resolve := false
|
||||
|
Reference in New Issue
Block a user