Add menued manysize test
This commit is contained in:
parent
4b6cc33208
commit
b0d0fde3e0
@ -220,3 +220,33 @@ func TestManySizes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user