package common import "testing" func TestJoinRawArray(t *testing.T) { tests := []struct { name string items [][]byte want string }{ {name: "empty", want: "[]"}, {name: "single", items: [][]byte{[]byte(`{"id":1}`)}, want: `[{"id":1}]`}, {name: "multiple", items: [][]byte{[]byte(`{"id":1}`), []byte(`{"id":2}`)}, want: `[{"id":1},{"id":2}]`}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { if got := string(JoinRawArray(test.items)); got != test.want { t.Fatalf("JoinRawArray() = %s, want %s", got, test.want) } }) } }