diff options
author | Cameron Moore <moorereason@gmail.com> | 2020-10-15 13:54:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-15 20:54:47 +0200 |
commit | acfa153863d6ff2acf17ffb4395e05d102229905 (patch) | |
tree | ee95be21ca3c7c6bad3900e3a4143a3b5303acff /output/layout_test.go | |
parent | f033d9f01d13d8cd08205ccfaa09919ed15dca77 (diff) |
output: Improve layout path construction
Diffstat (limited to 'output/layout_test.go')
-rw-r--r-- | output/layout_test.go | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/output/layout_test.go b/output/layout_test.go index 5651a09b9..38b9d5faf 100644 --- a/output/layout_test.go +++ b/output/layout_test.go @@ -663,13 +663,25 @@ func TestLayout(t *testing.T) { } func BenchmarkLayout(b *testing.B) { - c := qt.New(b) descriptor := LayoutDescriptor{Kind: "taxonomy", Section: "categories"} l := NewLayoutHandler() for i := 0; i < b.N; i++ { - layouts, err := l.For(descriptor, HTMLFormat) - c.Assert(err, qt.IsNil) - c.Assert(layouts, qt.Not(qt.HasLen), 0) + _, err := l.For(descriptor, HTMLFormat) + if err != nil { + panic(err) + } + } +} + +func BenchmarkLayoutUncached(b *testing.B) { + for i := 0; i < b.N; i++ { + descriptor := LayoutDescriptor{Kind: "taxonomy", Section: "categories"} + l := NewLayoutHandler() + + _, err := l.For(descriptor, HTMLFormat) + if err != nil { + panic(err) + } } } |