mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-13 07:10:25 +08:00
优化节点配置生成速度
This commit is contained in:
26
internal/utils/cache_map_test.go
Normal file
26
internal/utils/cache_map_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewCacheMap(t *testing.T) {
|
||||
var a = assert.NewAssertion(t)
|
||||
|
||||
m := NewCacheMap()
|
||||
{
|
||||
m.Put("Hello", "World")
|
||||
v, ok := m.Get("Hello")
|
||||
a.IsTrue(ok)
|
||||
a.IsTrue(v == "World")
|
||||
}
|
||||
|
||||
{
|
||||
v, ok := m.Get("Hello1")
|
||||
a.IsFalse(ok)
|
||||
a.IsTrue(v == nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user