mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 20:02:26 -05: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:
parent
b7dd32da42
commit
37b4d9d179
11 changed files with 409 additions and 211 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue