mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-23 14:32:25 +00:00
27 lines
542 B
Go
27 lines
542 B
Go
|
package xsync_test
|
||
|
|
||
|
import (
|
||
|
. "github.com/go-skynet/LocalAI/pkg/xsync"
|
||
|
|
||
|
. "github.com/onsi/ginkgo/v2"
|
||
|
. "github.com/onsi/gomega"
|
||
|
)
|
||
|
|
||
|
var _ = Describe("SyncMap", func() {
|
||
|
|
||
|
Context("Syncmap", func() {
|
||
|
It("sets and gets", func() {
|
||
|
m := NewSyncedMap[string, string]()
|
||
|
m.Set("foo", "bar")
|
||
|
Expect(m.Get("foo")).To(Equal("bar"))
|
||
|
})
|
||
|
It("deletes", func() {
|
||
|
m := NewSyncedMap[string, string]()
|
||
|
m.Set("foo", "bar")
|
||
|
m.Delete("foo")
|
||
|
Expect(m.Get("foo")).To(Equal(""))
|
||
|
Expect(m.Exists("foo")).To(Equal(false))
|
||
|
})
|
||
|
})
|
||
|
})
|