github.com/lingyao2333/mo-zero@v1.4.1/core/stores/redis/scriptcache_test.go (about) 1 package redis 2 3 import ( 4 "testing" 5 6 "github.com/lingyao2333/mo-zero/core/logx" 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestScriptCache(t *testing.T) { 11 logx.Disable() 12 13 cache := GetScriptCache() 14 cache.SetSha("foo", "bar") 15 cache.SetSha("bla", "blabla") 16 bar, ok := cache.GetSha("foo") 17 assert.True(t, ok) 18 assert.Equal(t, "bar", bar) 19 }