...
1 package sessions
2
3 import (
4 "testing"
5 )
6
7 const redisTestServer = "localhost:6379"
8
9 var newRedisStore = func(_ *testing.T) Store {
10 store, err := NewRedisStore(10, "tcp", redisTestServer, "", []byte("secret"))
11 if err != nil {
12 panic(err)
13 }
14 return store
15 }
16
17 func TestRedis_SessionGetSet(t *testing.T) {
18 sessionGetSet(t, newRedisStore)
19 }
20
21 func TestRedis_SessionDeleteKey(t *testing.T) {
22 sessionDeleteKey(t, newRedisStore)
23 }
24
25 func TestRedis_SessionFlashes(t *testing.T) {
26 sessionFlashes(t, newRedisStore)
27 }
28
29 func TestRedis_SessionClear(t *testing.T) {
30 sessionClear(t, newRedisStore)
31 }
32
33 func TestRedis_SessionOptions(t *testing.T) {
34 sessionOptions(t, newRedisStore)
35 }
36
View as plain text