cache_sqlite_test.go 459 B

1234567891011121314151617181920212223
  1. package server
  2. import (
  3. "path/filepath"
  4. "testing"
  5. )
  6. func TestSqliteCache_AddMessage(t *testing.T) {
  7. testCacheMessages(t, newSqliteTestCache(t))
  8. }
  9. func TestSqliteCache_MessagesTagsPrioAndTitle(t *testing.T) {
  10. testCacheMessagesTagsPrioAndTitle(t, newSqliteTestCache(t))
  11. }
  12. func newSqliteTestCache(t *testing.T) cache {
  13. filename := filepath.Join(t.TempDir(), "cache.db")
  14. c, err := newSqliteCache(filename)
  15. if err != nil {
  16. t.Fatal(err)
  17. }
  18. return c
  19. }