Files
zeekay 6759ac456c Rebrand PocketBase imports to Hanzo Base across all Go files
Replace github.com/pocketbase/pocketbase with github.com/hanzoai/base
in 106 Go source files. Keep pocketbase/dbx and pocketbase/tygoja as-is
(upstream dependencies). Add compiled binary to .gitignore. Include
realtime DX design document inspired by Convex patterns.
2026-02-27 09:43:39 -08:00

26 lines
456 B
Go

package subscriptions_test
import (
"strings"
"testing"
"github.com/hanzoai/base/tools/subscriptions"
)
func TestMessageWrite(t *testing.T) {
m := subscriptions.Message{
Name: "test_name",
Data: []byte("test_data"),
}
var sb strings.Builder
m.WriteSSE(&sb, "test_id")
expected := "id:test_id\nevent:test_name\ndata:test_data\n\n"
if v := sb.String(); v != expected {
t.Fatalf("Expected writer content\n%q\ngot\n%q", expected, v)
}
}