MCPcopy
hub / github.com/pocketbase/pocketbase / TestSet

Function TestSet

tools/store/store_test.go:229–250  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestSet(t *testing.T) {
230 s := store.Store[string, int]{}
231
232 data := map[string]int{"test1": 0, "test2": 1, "test3": 3}
233
234 // set values
235 for k, v := range data {
236 s.Set(k, v)
237 }
238
239 // verify that the values are set
240 for k, v := range data {
241 if !s.Has(k) {
242 t.Errorf("Expected key %q", k)
243 }
244
245 val := s.Get(k)
246 if val != v {
247 t.Errorf("Expected %v, got %v for key %q", v, val, k)
248 }
249 }
250}
251
252func TestSetFunc(t *testing.T) {
253 s := store.Store[string, int]{}

Callers

nothing calls this directly

Calls 3

SetMethod · 0.65
GetMethod · 0.65
HasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…