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