Added unit tests
Этот коммит содержится в:
@@ -6,7 +6,6 @@ package store
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mattermost/platform/model"
|
"github.com/mattermost/platform/model"
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
package store
|
package store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/platform/model"
|
|
||||||
"github.com/mattermost/platform/utils"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/mattermost/platform/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPostStoreSave(t *testing.T) {
|
func TestPostStoreSave(t *testing.T) {
|
||||||
@@ -547,11 +547,9 @@ func TestPostStoreSearch(t *testing.T) {
|
|||||||
t.Fatal("returned wrong serach result")
|
t.Fatal("returned wrong serach result")
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.Cfg.SqlSettings.DriverName == "mysql" {
|
r5 := (<-store.Post().Search(teamId, userId, "matter*", false)).Data.(*model.PostList)
|
||||||
r5 := (<-store.Post().Search(teamId, userId, "matter*", false)).Data.(*model.PostList)
|
if len(r5.Order) != 1 && r5.Order[0] != o1.Id {
|
||||||
if len(r5.Order) != 1 && r5.Order[0] != o1.Id {
|
t.Fatal("returned wrong serach result")
|
||||||
t.Fatal("returned wrong serach result")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r6 := (<-store.Post().Search(teamId, userId, "#hashtag", true)).Data.(*model.PostList)
|
r6 := (<-store.Post().Search(teamId, userId, "#hashtag", true)).Data.(*model.PostList)
|
||||||
@@ -573,4 +571,9 @@ func TestPostStoreSearch(t *testing.T) {
|
|||||||
if len(r9.Order) != 2 {
|
if len(r9.Order) != 2 {
|
||||||
t.Fatal("returned wrong search result")
|
t.Fatal("returned wrong search result")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r10 := (<-store.Post().Search(teamId, userId, "matter* jer*", false)).Data.(*model.PostList)
|
||||||
|
if len(r10.Order) != 2 {
|
||||||
|
t.Fatal("returned wrong search result")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user