mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 08:33:33 -06:00
[bugfix] Narrow search scope for accounts starting with '@'; don't LOWER SQLite text searches (#2435)
This commit is contained in:
parent
d60edf7ec6
commit
3f070a442a
4 changed files with 104 additions and 56 deletions
|
|
@ -37,6 +37,24 @@ func (suite *SearchTestSuite) TestSearchAccountsTurtleAny() {
|
|||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccounts1HappyWithPrefix() {
|
||||
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"]
|
||||
|
||||
// Query will do the full coalesce.
|
||||
accounts, err := suite.db.SearchForAccounts(context.Background(), testAccount.ID, "1happy", "", "", 10, false, 0)
|
||||
suite.NoError(err)
|
||||
suite.Len(accounts, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchAccountsTurtleFollowing() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue