diff --git a/internal/caches/list_file_hash_map_test.go b/internal/caches/list_file_hash_map_test.go index 9632892..f9481fa 100644 --- a/internal/caches/list_file_hash_map_test.go +++ b/internal/caches/list_file_hash_map_test.go @@ -6,6 +6,7 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/caches" "github.com/TeaOSLab/EdgeNode/internal/zero" "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/assert" "github.com/iwind/TeaGo/rands" "github.com/iwind/TeaGo/types" stringutil "github.com/iwind/TeaGo/utils/string" @@ -112,6 +113,18 @@ func TestFileListHashMap_Load(t *testing.T) { } } +func TestFileListHashMap_Delete(t *testing.T) { + var a = assert.NewAssertion(t) + + var m = caches.NewFileListHashMap() + m.SetIsReady(true) + m.SetIsAvailable(true) + m.Add("a") + a.IsTrue(m.Len() == 1) + m.Delete("a") + a.IsTrue(m.Len() == 0) +} + func Benchmark_BigInt(b *testing.B) { var hash = stringutil.Md5("123456") b.ResetTimer()