Skip to content
Myr

improve render code coverage (#1474)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

all code coverage > 99%

authored by 田欧 · committed by Bo-Yi Wu · parent 202db4f · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:render/render_test.go+15 added
156 unmodified lines
157 assert.Equal(t, "x([{\"foo\":\"bar\"},{\"bar\":\"foo\"}])", w2.Body.String())158 assert.Equal(t, "application/javascript; charset=utf-8", w2.Header().Get("Content-Type"))159}160161func TestRenderJsonpJSONError2(t *testing.T) {162 w := httptest.NewRecorder()163 data := map[string]interface{}{164 "foo": "bar",165 }166 (JsonpJSON{"", data}).WriteContentType(w)167 assert.Equal(t, "application/javascript; charset=utf-8", w.Header().Get("Content-Type"))168169 e := (JsonpJSON{"", data}).Render(w)170 assert.NoError(t, e)171172 assert.Equal(t, "{\"foo\":\"bar\"}", w.Body.String())173 assert.Equal(t, "application/javascript; charset=utf-8", w.Header().Get("Content-Type"))174}175176func TestRenderJsonpJSONFail(t *testing.T) {177 w := httptest.NewRecorder()178 data := make(chan int)179
274 unmodified lines