mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-01 04:03:32 -06:00
[bugfix] Better Postgres search case insensitivity (#2526)
* [bugfix] Better Postgres search case insensitivity * use ilike for postgres
This commit is contained in:
parent
486585890d
commit
c5eced5fd1
3 changed files with 58 additions and 29 deletions
|
|
@ -46,6 +46,15 @@ func (suite *SearchTestSuite) TestSearchAccounts1HappyWithPrefix() {
|
|||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccounts1HappyWithPrefixUpper() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
// Query will just look for usernames that start with "1HAPPY".
|
||||
accounts, err := suite.db.SearchForAccounts(context.Background(), testAccount.ID, "@1HAPPY", "", "", 10, false, 0)
|
||||
suite.NoError(err)
|
||||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccounts1HappyNoPrefix() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
|
|
@ -63,6 +72,14 @@ func (suite *SearchTestSuite) TestSearchAccountsTurtleFollowing() {
|
|||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccountsTurtleFollowingUpper() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
accounts, err := suite.db.SearchForAccounts(context.Background(), testAccount.ID, "TURTLE", "", "", 10, true, 0)
|
||||
suite.NoError(err)
|
||||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccountsPostFollowing() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue