From 19d6ef4703a1e8238aabd2df5f70f3a2c0a5522f Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 6 Nov 2023 18:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file_hash_map_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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()