1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/vendor/github.com/gin-contrib/sessions/memcached_test.go

34 lines
735 B
Go
Raw Normal View History

2017-10-03 21:43:55 +03:00
package sessions
import (
"github.com/bradfitz/gomemcache/memcache"
"testing"
)
const memcachedTestServer = "localhost:11211"
var newMemcachedStore = func(_ *testing.T) Store {
store := NewMemcacheStore(memcache.New(memcachedTestServer), "", []byte("secret"))
return store
}
func TestMemcached_SessionGetSet(t *testing.T) {
sessionGetSet(t, newMemcachedStore)
}
func TestMemcached_SessionDeleteKey(t *testing.T) {
sessionDeleteKey(t, newMemcachedStore)
}
func TestMemcached_SessionFlashes(t *testing.T) {
sessionFlashes(t, newMemcachedStore)
}
func TestMemcached_SessionClear(t *testing.T) {
sessionClear(t, newMemcachedStore)
}
func TestMemcached_SessionOptions(t *testing.T) {
sessionOptions(t, newMemcachedStore)
}