(t *testing.T)
| 1398 | } |
| 1399 | |
| 1400 | func TestContextRenderSSE(t *testing.T) { |
| 1401 | w := httptest.NewRecorder() |
| 1402 | c, _ := CreateTestContext(w) |
| 1403 | |
| 1404 | c.SSEvent("float", 1.5) |
| 1405 | c.Render(-1, sse.Event{ |
| 1406 | Id: "123", |
| 1407 | Data: "text", |
| 1408 | }) |
| 1409 | c.SSEvent("chat", H{ |
| 1410 | "foo": "bar", |
| 1411 | "bar": "foo", |
| 1412 | }) |
| 1413 | |
| 1414 | assert.Equal(t, strings.ReplaceAll(w.Body.String(), " ", ""), strings.ReplaceAll("event:float\ndata:1.5\n\nid:123\ndata:text\n\nevent:chat\ndata:{\"bar\":\"foo\",\"foo\":\"bar\"}\n\n", " ", "")) |
| 1415 | } |
| 1416 | |
| 1417 | func TestContextRenderFile(t *testing.T) { |
| 1418 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected