github.com/vicanso/pike@v1.0.1-0.20210630235453-9099e041f6ec/cache/memhash_test.go (about) 1 package cache 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestMemHash(t *testing.T) { 10 assert := assert.New(t) 11 12 data := "GET aslant.site /users/v1/me" 13 v := MemHash([]byte(data)) 14 assert.Equal(v, MemHash([]byte(data))) 15 assert.Equal(v, MemHashString(data)) 16 17 assert.NotEqual(v, MemHash([]byte("abc"))) 18 }