MCPcopy
hub / github.com/pocketbase/pocketbase / TestGetAll

Function TestGetAll

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

Source from the content-addressed store, hash-verified

178}
179
180func TestGetAll(t *testing.T) {
181 data := map[string]int{
182 "a": 1,
183 "b": 2,
184 }
185
186 s := store.New(data)
187
188 // fetch and delete each key to make sure that it was shallow copied
189 result := s.GetAll()
190 for k := range result {
191 delete(result, k)
192 }
193
194 // refetch again
195 result = s.GetAll()
196
197 if len(result) != len(data) {
198 t.Fatalf("Expected %d, got %d items", len(data), len(result))
199 }
200
201 for k := range result {
202 if result[k] != data[k] {
203 t.Fatalf("Expected %s to be %v, got %v", k, data[k], result[k])
204 }
205 }
206}
207
208func TestValues(t *testing.T) {
209 data := map[string]int{

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
GetAllMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…