Add tests for RuleTargetAxis.

This commit is contained in:
Anna Rose Wiggins 2025-07-10 16:46:01 -04:00
parent 8f3b8f4b47
commit 6646044d28
8 changed files with 164 additions and 9 deletions

View file

@ -23,5 +23,6 @@ func (rule *MappingRuleAxis) MatchEvent(device *evdev.InputDevice, event *evdev.
return nil, nil
}
return rule.Output.Device, rule.Output.CreateEvent(rule.Input.NormalizeValue(event.Value), mode)
// The cast here is safe because the interface is only ever different for unit tests
return rule.Output.Device.(*evdev.InputDevice), rule.Output.CreateEvent(rule.Input.NormalizeValue(event.Value), mode)
}