(WIP) Move rule initialization into rule package.

This commit is contained in:
Anna Rose Wiggins 2025-08-11 19:09:37 -04:00
parent 727985f91c
commit 9e4062ba30
21 changed files with 366 additions and 489 deletions

View file

@ -28,7 +28,11 @@ func (t *MappingRuleButtonTests) SetupTest() {
func (t *MappingRuleButtonTests) TestMatchEvent() {
inputButton, _ := NewRuleTargetButton("", t.inputDevice, evdev.BTN_TRIGGER, false)
outputButton, _ := NewRuleTargetButton("", t.outputDevice, evdev.BTN_TRIGGER, false)
testRule := NewMappingRuleButton(t.base, inputButton, outputButton)
testRule := &MappingRuleButton{
MappingRuleBase: t.base,
Input: inputButton,
Output: outputButton,
}
// A matching input event should produce an output event
expected := &evdev.InputEvent{
@ -58,7 +62,11 @@ func (t *MappingRuleButtonTests) TestMatchEvent() {
func (t *MappingRuleButtonTests) TestMatchEventInverted() {
inputButton, _ := NewRuleTargetButton("", t.inputDevice, evdev.BTN_TRIGGER, true)
outputButton, _ := NewRuleTargetButton("", t.outputDevice, evdev.BTN_TRIGGER, false)
testRule := NewMappingRuleButton(t.base, inputButton, outputButton)
testRule := &MappingRuleButton{
MappingRuleBase: t.base,
Input: inputButton,
Output: outputButton,
}
// A matching input event should produce an output event
expected := &evdev.InputEvent{