(b *testing.B)
| 87 | } |
| 88 | |
| 89 | func BenchmarkSmallHTMLBuffers(b *testing.B) { |
| 90 | b.ReportAllocs() |
| 91 | |
| 92 | render := New(Options{ |
| 93 | Directory: "testdata/basic", |
| 94 | |
| 95 | // Tiny 8 bytes buffers -> should lead to allocations |
| 96 | // on every template render |
| 97 | BufferPool: NewSizedBufferPool(32, 8), |
| 98 | }) |
| 99 | |
| 100 | buf := new(bytes.Buffer) |
| 101 | for i := 0; i < b.N; i++ { |
| 102 | _ = render.HTML(buf, http.StatusOK, "hello", "gophers") |
| 103 | buf.Reset() |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestHTMLXHTML(t *testing.T) { |
| 108 | render := New(Options{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…