scriptcache_test.go 283 B

12345678910111213141516
  1. package redis
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestScriptCache(t *testing.T) {
  7. cache := GetScriptCache()
  8. cache.SetSha("foo", "bar")
  9. cache.SetSha("bla", "blabla")
  10. bar, ok := cache.GetSha("foo")
  11. assert.True(t, ok)
  12. assert.Equal(t, "bar", bar)
  13. }