mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
io/router: don't panic if AppendSemantics is called without a frame
Fixes: https://todo.sr.ht/~eliasnaur/gio/328 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -15,6 +15,14 @@ import (
|
||||
"gioui.org/op/clip"
|
||||
)
|
||||
|
||||
func TestEmptySemantics(t *testing.T) {
|
||||
var r Router
|
||||
tree := r.AppendSemantics(nil)
|
||||
if len(tree) != 1 {
|
||||
t.Errorf("expected 1 semantic node for empty tree, got %d", len(tree))
|
||||
}
|
||||
}
|
||||
|
||||
func TestSemanticTree(t *testing.T) {
|
||||
var (
|
||||
ops op.Ops
|
||||
|
||||
Reference in New Issue
Block a user