From b69221aa7fec759edb856e7b44ee24769b87486d Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 26 Aug 2015 06:40:41 -0700 Subject: Added unit tests --- store/sql_post_store.go | 1 - store/sql_post_store_test.go | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'store') diff --git a/store/sql_post_store.go b/store/sql_post_store.go index e30691154..4a3e7e4ed 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -6,7 +6,6 @@ package store import ( "fmt" "regexp" - "strconv" "strings" "github.com/mattermost/platform/model" diff --git a/store/sql_post_store_test.go b/store/sql_post_store_test.go index 8854fb5c4..7754b8275 100644 --- a/store/sql_post_store_test.go +++ b/store/sql_post_store_test.go @@ -4,11 +4,11 @@ package store import ( - "github.com/mattermost/platform/model" - "github.com/mattermost/platform/utils" "strings" "testing" "time" + + "github.com/mattermost/platform/model" ) func TestPostStoreSave(t *testing.T) { @@ -547,11 +547,9 @@ func TestPostStoreSearch(t *testing.T) { t.Fatal("returned wrong serach result") } - if utils.Cfg.SqlSettings.DriverName == "mysql" { - r5 := (<-store.Post().Search(teamId, userId, "matter*", false)).Data.(*model.PostList) - if len(r5.Order) != 1 && r5.Order[0] != o1.Id { - t.Fatal("returned wrong serach result") - } + r5 := (<-store.Post().Search(teamId, userId, "matter*", false)).Data.(*model.PostList) + if len(r5.Order) != 1 && r5.Order[0] != o1.Id { + t.Fatal("returned wrong serach result") } 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 { 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") + } } -- cgit v1.2.3-1-g7c22