MCPcopy Create free account
hub / github.com/gioui/gio / assertEventTypeSequence

Function assertEventTypeSequence

io/input/pointer_test.go:1260–1272  ·  view source on GitHub ↗

assertEventTypeSequence checks that the provided event types match expected.

(t *testing.T, got []event.Event, expected ...event.Event)

Source from the content-addressed store, hash-verified

1258
1259// assertEventTypeSequence checks that the provided event types match expected.
1260func assertEventTypeSequence(t *testing.T, got []event.Event, expected ...event.Event) {
1261 t.Helper()
1262 match := len(expected) == len(got)
1263 if match {
1264 for i, ge := range got {
1265 exp := expected[i]
1266 match = match && reflect.TypeOf(ge) == reflect.TypeOf(exp)
1267 }
1268 }
1269 if !match {
1270 t.Errorf("expected event types %s, got %s", eventTypesToString(expected), eventTypesToString(got))
1271 }
1272}
1273
1274func eventTypesToString(evs []event.Event) string {
1275 var s []string

Callers 2

Calls 1

eventTypesToStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…