io/input: tighten tests

Now that event delivery can be interleaved with commands, tests can be
made more precise.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-11-27 11:30:34 -06:00
parent ed0d5d5767
commit 20c28ef282
6 changed files with 277 additions and 496 deletions
+1 -1
View File
@@ -902,11 +902,11 @@ g 2 4 6 8 g
var tim time.Duration
selected := func(start, end int) string {
gtx.Execute(key.FocusCmd{Tag: e})
// Layout once with no events; populate e.lines.
e.Layout(gtx, cache, font, fontSize, op.CallOp{}, op.CallOp{})
e.Events() // throw away any events from this layout
gtx.Execute(key.FocusCmd{Tag: e})
r.Frame(gtx.Ops)
gtx.Source = r.Source()
// Build the selection events