Update existing tests.
This commit is contained in:
parent
623cd12407
commit
72d0d21e18
1 changed files with 6 additions and 6 deletions
|
@ -17,7 +17,7 @@ func TestRunnerDevicesConfig(t *testing.T) {
|
|||
|
||||
func (t *DevicesConfigTests) TestMakeAxes() {
|
||||
t.Run("8 axes", func() {
|
||||
axes := makeAxes(8)
|
||||
axes := makeAxes(8, []string{})
|
||||
t.Equal(8, len(axes))
|
||||
t.Contains(axes, evdev.EvCode(evdev.ABS_X))
|
||||
t.Contains(axes, evdev.EvCode(evdev.ABS_Y))
|
||||
|
@ -30,12 +30,12 @@ func (t *DevicesConfigTests) TestMakeAxes() {
|
|||
})
|
||||
|
||||
t.Run("9 axes is truncated", func() {
|
||||
axes := makeAxes(9)
|
||||
axes := makeAxes(9, []string{})
|
||||
t.Equal(8, len(axes))
|
||||
})
|
||||
|
||||
t.Run("3 axes", func() {
|
||||
axes := makeAxes(3)
|
||||
axes := makeAxes(3, []string{})
|
||||
t.Equal(3, len(axes))
|
||||
t.Contains(axes, evdev.EvCode(evdev.ABS_X))
|
||||
t.Contains(axes, evdev.EvCode(evdev.ABS_Y))
|
||||
|
@ -45,17 +45,17 @@ func (t *DevicesConfigTests) TestMakeAxes() {
|
|||
|
||||
func (t *DevicesConfigTests) TestMakeButtons() {
|
||||
t.Run("Maximum buttons", func() {
|
||||
buttons := makeButtons(VirtualDeviceMaxButtons)
|
||||
buttons := makeButtons(VirtualDeviceMaxButtons, []string{})
|
||||
t.Equal(VirtualDeviceMaxButtons, len(buttons))
|
||||
})
|
||||
|
||||
t.Run("Truncated buttons", func() {
|
||||
buttons := makeButtons(VirtualDeviceMaxButtons + 1)
|
||||
buttons := makeButtons(VirtualDeviceMaxButtons+1, []string{})
|
||||
t.Equal(VirtualDeviceMaxButtons, len(buttons))
|
||||
})
|
||||
|
||||
t.Run("16 buttons", func() {
|
||||
buttons := makeButtons(16)
|
||||
buttons := makeButtons(16, []string{})
|
||||
t.Equal(16, len(buttons))
|
||||
t.Contains(buttons, evdev.EvCode(evdev.BTN_DEAD))
|
||||
t.NotContains(buttons, evdev.EvCode(evdev.BTN_TRIGGER_HAPPY))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue