Begin unit tests, relates to #35
This commit is contained in:
23
server/cache_sqlite_test.go
Normal file
23
server/cache_sqlite_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSqliteCache_AddMessage(t *testing.T) {
|
||||
testCacheMessages(t, newSqliteTestCache(t))
|
||||
}
|
||||
|
||||
func TestSqliteCache_MessagesTagsPrioAndTitle(t *testing.T) {
|
||||
testCacheMessagesTagsPrioAndTitle(t, newSqliteTestCache(t))
|
||||
}
|
||||
|
||||
func newSqliteTestCache(t *testing.T) cache {
|
||||
filename := filepath.Join(t.TempDir(), "cache.db")
|
||||
c, err := newSqliteCache(filename)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return c
|
||||
}
|
||||
Reference in New Issue
Block a user