mirror of
https://github.com/gofiber/storage.git
synced 2025-10-04 16:22:52 +08:00
Standardize test case names
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/gofiber/utils"
|
"github.com/gofiber/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_Set(t *testing.T) {
|
func Test_Memory_Set(t *testing.T) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ func Test_Set(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_SetExpiry(t *testing.T) {
|
func Test_Memory_SetExpiry(t *testing.T) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ func Test_SetExpiry(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// func Test_GC(t *testing.T) {
|
// func Test_Memory_GC(t *testing.T) {
|
||||||
|
|
||||||
// // New() isn't being used here so the gcInterval can be set low
|
// // New() isn't being used here so the gcInterval can be set low
|
||||||
// store := &Storage{
|
// store := &Storage{
|
||||||
@@ -67,7 +67,7 @@ func Test_SetExpiry(t *testing.T) {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
func Test_Get(t *testing.T) {
|
func Test_Memory_Get(t *testing.T) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ func Test_Get(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Delete(t *testing.T) {
|
func Test_Memory_Delete(t *testing.T) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ func Test_Delete(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Clear(t *testing.T) {
|
func Test_Memory_Clear(t *testing.T) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ func Test_Clear(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Benchmark_Set(b *testing.B) {
|
func Benchmark_Memory_Set(b *testing.B) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ func Benchmark_Set(b *testing.B) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Benchmark_Get(b *testing.B) {
|
func Benchmark_Memory_Get(b *testing.B) {
|
||||||
|
|
||||||
store := New()
|
store := New()
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ func contains(arr []string, item string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMongoStore_Set_Get(t *testing.T) {
|
func Test_MongoDB_Set_Get(t *testing.T) {
|
||||||
if uri == "" {
|
if uri == "" {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ func TestMongoStore_Set_Get(t *testing.T) {
|
|||||||
utils.AssertEqual(t, value, getVal, "correctly set and get value")
|
utils.AssertEqual(t, value, getVal, "correctly set and get value")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMongoStore_Get_Invalid(t *testing.T) {
|
func Test_MongoDB_Get_Invalid(t *testing.T) {
|
||||||
if uri == "" {
|
if uri == "" {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ func TestMongoStore_Get_Invalid(t *testing.T) {
|
|||||||
utils.AssertEqual(t, true, getVal == nil, "get nil if key not found")
|
utils.AssertEqual(t, true, getVal == nil, "get nil if key not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMongoStore_Delete(t *testing.T) {
|
func Test_MongoDB_Delete(t *testing.T) {
|
||||||
if uri == "" {
|
if uri == "" {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ func TestMongoStore_Delete(t *testing.T) {
|
|||||||
utils.AssertEqual(t, true, getVal == nil, "correctly delete value")
|
utils.AssertEqual(t, true, getVal == nil, "correctly delete value")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMongoStore_Clear(t *testing.T) {
|
func Test_MongoDB_Clear(t *testing.T) {
|
||||||
if uri == "" {
|
if uri == "" {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Set(t *testing.T) {
|
func Test_MySQL_Set(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ func Test_Set(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_SetExpiry(t *testing.T) {
|
func Test_MySQL_SetExpiry(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ func Test_SetExpiry(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Get(t *testing.T) {
|
func Test_MySQL_Get(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ func Test_Get(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Get_NoRows(t *testing.T) {
|
func Test_MySQL_Get_NoRows(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ func Test_Get_NoRows(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Get_Expired(t *testing.T) {
|
func Test_MySQL_Get_Expired(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ func Test_Get_Expired(t *testing.T) {
|
|||||||
utils.AssertEqual(t, 0, len(returnedValue))
|
utils.AssertEqual(t, 0, len(returnedValue))
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Delete(t *testing.T) {
|
func Test_MySQL_Delete(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ func Test_Delete(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Clear(t *testing.T) {
|
func Test_MySQL_Clear(t *testing.T) {
|
||||||
|
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ func Test_Clear(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Benchmark_Set(b *testing.B) {
|
func Benchmark_MySQL_Set(b *testing.B) {
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
key := "aaaa"
|
key := "aaaa"
|
||||||
@@ -168,7 +168,7 @@ func Benchmark_Set(b *testing.B) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Benchmark_Get(b *testing.B) {
|
func Benchmark_MySQL_Get(b *testing.B) {
|
||||||
store := New(storeConfig)
|
store := New(storeConfig)
|
||||||
|
|
||||||
key := "aaaa"
|
key := "aaaa"
|
||||||
|
@@ -12,7 +12,7 @@ func Test_New(t *testing.T) {
|
|||||||
New()
|
New()
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Get_Set(t *testing.T) {
|
func Test_Sqlite_Get_Set(t *testing.T) {
|
||||||
s := New(Config{
|
s := New(Config{
|
||||||
Database: ":memory:",
|
Database: ":memory:",
|
||||||
})
|
})
|
||||||
@@ -24,7 +24,7 @@ func Test_Get_Set(t *testing.T) {
|
|||||||
utils.AssertEqual(t, []byte("yes!"), b)
|
utils.AssertEqual(t, []byte("yes!"), b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Expiration(t *testing.T) {
|
func Test_Sqlite_Expiration(t *testing.T) {
|
||||||
s := New(Config{
|
s := New(Config{
|
||||||
Database: ":memory:",
|
Database: ":memory:",
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user