MCPcopy
hub / github.com/pocketbase/pocketbase / TestMarshalJSON

Function TestMarshalJSON

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

Source from the content-addressed store, hash-verified

365}
366
367func TestMarshalJSON(t *testing.T) {
368 s := &store.Store[string, string]{}
369 s.Set("a", "test1")
370 s.Set("b", "test2")
371
372 expected := []byte(`{"a":"test1", "b":"test2"}`)
373
374 result, err := json.Marshal(s)
375 if err != nil {
376 t.Fatal(err)
377 }
378
379 if bytes.Equal(result, expected) {
380 t.Fatalf("Expected\n%s\ngot\n%s", expected, result)
381 }
382}
383
384func TestShrink(t *testing.T) {
385 s := &store.Store[string, int]{}

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…