kefu/tools/memory_test.go

17 lines
271 B
Go
Raw Permalink Normal View History

2024-12-10 02:50:12 +00:00
package tools
import (
"log"
"testing"
"time"
)
func TestNewMemory(t *testing.T) {
mem := NewMemory()
mem.Set("name", "livechat", time.Duration(10)*time.Second)
time.Sleep(time.Duration(2) * time.Second)
mem.Clean()
name := mem.Get("name")
log.Println(name)
}