MCPcopy
hub / github.com/pocketbase/pocketbase / TestMessageWrite

Function TestMessageWrite

tools/subscriptions/message_test.go:10–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestMessageWrite(t *testing.T) {
11 m := subscriptions.Message{
12 Name: "test_name",
13 Data: []byte("test_data"),
14 }
15
16 var sb strings.Builder
17
18 m.WriteSSE(&sb, "test_id")
19
20 expected := "id:test_id\nevent:test_name\ndata:test_data\n\n"
21
22 if v := sb.String(); v != expected {
23 t.Fatalf("Expected writer content\n%q\ngot\n%q", expected, v)
24 }
25}

Callers

nothing calls this directly

Calls 2

WriteSSEMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…