go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit b0d0fde3e0f0060f96e40e80b931282a0cdbde3f
parent 4b6cc33208fd6030808e5ebe3bdea30a2030d3f6
Author: lash <dev@holbrook.no>
Date:   Fri, 14 Apr 2023 09:12:32 +0100

Add menued manysize test

Diffstat:
Mrender/size_test.go | 32+++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/render/size_test.go b/render/size_test.go @@ -219,4 +219,34 @@ func TestManySizes(t *testing.T) { t.Fatal(err) } } -} +} + +func TestManySizesMenued(t *testing.T) { + for i := 60; i < 128; i++ { + st := state.NewState(0) + ca := cache.NewCache() + mn := NewMenu().WithOutputSize(32) + mrs := resource.NewMenuResource().WithEntryFuncGetter(funcFor).WithTemplateGetter(getTemplate) + rs := TestSizeResource{ + mrs, + } + szr := NewSizer(uint32(i)) + pg := NewPage(ca, rs).WithSizer(szr).WithMenu(mn) + ca.Push() + st.Down("pages") + ca.Add("foo", "inky", 10) + ca.Add("bar", "pinky", 10) + ca.Add("baz", "blinky", 10) + ca.Add("xyzzy", "inky pinky\nblinky clyde sue\ntinkywinky dipsy\nlala poo\none two three four five six seven\neight nine ten\neleven twelve", 0) + pg.Map("foo") + pg.Map("bar") + pg.Map("baz") + pg.Map("xyzzy") + mn.Put("0", "yay") + mn.Put("12", "nay") + _, err := pg.Render("pages", 0) + if err != nil { + t.Fatal(err) + } + } +}