go-vise

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

commit 89b0529cf7ac4542b498a94a4581508bd888834e
parent 9e6febe7b6010f9b2d50e1d3d0c130cfa35a5da9
Author: lash <dev@holbrook.no>
Date:   Thu, 26 Sep 2024 13:01:05 +0100

Update menusink test

Diffstat:
Mrender/size_test.go | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/render/size_test.go b/render/size_test.go @@ -332,11 +332,37 @@ func TestMenuSink(t *testing.T) { } expect = `bar xyzzy 3:clyde +11:next +22:previous` + if r != expect { + t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", expect, r) + } + + mn = NewMenu().WithSink().WithBrowseConfig(DefaultBrowseConfig()) + mn.Put("0", "inky") + mn.Put("1", "pinky") + mn.Put("22", "blinky") + mn.Put("3", "clyde") + mn.Put("44", "tinkywinky") + + pg = NewPage(ca, rs).WithSizer(szr).WithMenu(mn) + ca.Push() + + ca.Add("baz", "xyzzy", 5) + pg.Map("baz") + + + r, err = pg.Render(ctx, "foo", 2) + if err != nil { + t.Fatal(err) + } + expect = `bar xyzzy 44:tinkywinky 22:previous` if r != expect { t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", expect, r) } + } func TestMiddlePage(t *testing.T) {