MCPcopy
hub / github.com/pocketbase/pocketbase / TestValues

Function TestValues

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

Source from the content-addressed store, hash-verified

206}
207
208func TestValues(t *testing.T) {
209 data := map[string]int{
210 "a": 1,
211 "b": 2,
212 }
213
214 values := store.New(data).Values()
215
216 expected := []int{1, 2}
217
218 if len(values) != len(expected) {
219 t.Fatalf("Expected %d values, got %d", len(expected), len(values))
220 }
221
222 for _, v := range expected {
223 if !slices.Contains(values, v) {
224 t.Fatalf("Missing value %v in\n%v", v, values)
225 }
226 }
227}
228
229func TestSet(t *testing.T) {
230 s := store.Store[string, int]{}

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
ValuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…