diff --git a/memcache/memcache_test.go b/memcache/memcache_test.go index a3100896..82d262f6 100644 --- a/memcache/memcache_test.go +++ b/memcache/memcache_test.go @@ -21,6 +21,19 @@ func Test_Memcache_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_Memcache_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_Memcache_Get(t *testing.T) { var ( key = "john" diff --git a/memory/memory_test.go b/memory/memory_test.go index 2adb1fcc..a71bc531 100644 --- a/memory/memory_test.go +++ b/memory/memory_test.go @@ -21,6 +21,19 @@ func Test_Memory_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_Memory_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_Memory_Get(t *testing.T) { var ( key = "john" diff --git a/mongodb/mongodb_test.go b/mongodb/mongodb_test.go index b2f2395f..741911e7 100644 --- a/mongodb/mongodb_test.go +++ b/mongodb/mongodb_test.go @@ -23,6 +23,19 @@ func Test_MongoDB_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_MongoDB_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_MongoDB_Get(t *testing.T) { var ( key = "john" diff --git a/mysql/mysql_test.go b/mysql/mysql_test.go index 4958e909..d3c5c872 100644 --- a/mysql/mysql_test.go +++ b/mysql/mysql_test.go @@ -27,6 +27,19 @@ func Test_MYSQL_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_MYSQL_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_MYSQL_Get(t *testing.T) { var ( key = "john" @@ -66,7 +79,6 @@ func Test_MYSQL_Get_Expired(t *testing.T) { func Test_MYSQL_Get_NotExist(t *testing.T) { - result, err := testStore.Get("notexist") utils.AssertEqual(t, ErrNotExist, err) utils.AssertEqual(t, true, len(result) == 0) diff --git a/postgres/postgres_test.go b/postgres/postgres_test.go index 9b2064b3..99940446 100644 --- a/postgres/postgres_test.go +++ b/postgres/postgres_test.go @@ -27,6 +27,19 @@ func Test_Postgres_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_Postgres_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_Postgres_Get(t *testing.T) { var ( key = "john" diff --git a/redis/redis_test.go b/redis/redis_test.go index 92e34300..2fbb6235 100644 --- a/redis/redis_test.go +++ b/redis/redis_test.go @@ -23,6 +23,19 @@ func Test_Redis_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_Redis_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_Redis_Get(t *testing.T) { var ( key = "john" diff --git a/sqlite3/fiber.sqlite3 b/sqlite3/fiber.sqlite3 new file mode 100644 index 00000000..49f130ba Binary files /dev/null and b/sqlite3/fiber.sqlite3 differ diff --git a/sqlite3/sqlite3_test.go b/sqlite3/sqlite3_test.go index 07c72b84..68e68bc6 100644 --- a/sqlite3/sqlite3_test.go +++ b/sqlite3/sqlite3_test.go @@ -24,6 +24,19 @@ func Test_SQLite3_Set(t *testing.T) { utils.AssertEqual(t, nil, err) } +func Test_SQLite3_Set_Override(t *testing.T) { + var ( + key = "john" + val = []byte("doe") + ) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) + + err := testStore.Set(key, val, 0) + utils.AssertEqual(t, nil, err) +} + func Test_SQLite3_Get(t *testing.T) { var ( key = "john"