From 45f23ffc9d25bfd2a7f35bd7cad82ba4ef732110 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 27 May 2017 14:03:05 +0800 Subject: [PATCH] fix tests --- cache_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cache_test.go b/cache_test.go index 9b77b6b9..b293f896 100644 --- a/cache_test.go +++ b/cache_test.go @@ -62,7 +62,7 @@ func TestCacheFind(t *testing.T) { func TestCacheFind2(t *testing.T) { assert.NoError(t, prepareEngine()) - type MailBox struct { + type MailBox2 struct { Id uint64 Username string Password string @@ -71,9 +71,9 @@ func TestCacheFind2(t *testing.T) { cacher := NewLRUCacher2(NewMemoryStore(), time.Hour, 10000) testEngine.SetDefaultCacher(cacher) - assert.NoError(t, testEngine.Sync2(new(MailBox))) + assert.NoError(t, testEngine.Sync2(new(MailBox2))) - var inserts = []*MailBox{ + var inserts = []*MailBox2{ { Username: "user1", Password: "pass1", @@ -86,7 +86,7 @@ func TestCacheFind2(t *testing.T) { _, err := testEngine.Insert(inserts[0], inserts[1]) assert.NoError(t, err) - var boxes []MailBox + var boxes []MailBox2 assert.NoError(t, testEngine.Find(&boxes)) assert.EqualValues(t, 2, len(boxes)) for i, box := range boxes { @@ -95,7 +95,7 @@ func TestCacheFind2(t *testing.T) { assert.Equal(t, inserts[i].Password, box.Password) } - boxes = make([]MailBox, 0, 2) + boxes = make([]MailBox2, 0, 2) assert.NoError(t, testEngine.Find(&boxes)) assert.EqualValues(t, 2, len(boxes)) for i, box := range boxes {