27 lines
462 B
Go
27 lines
462 B
Go
//go:build integration
|
|
|
|
package output_test
|
|
|
|
import (
|
|
"mayhem-party/src/device/output"
|
|
"mayhem-party/src/device/output/key"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestKeyboardIntegration(t *testing.T) {
|
|
kb := output.NewKeyboard()
|
|
t.Cleanup(kb.Close)
|
|
|
|
t.Run("hold d", func(t *testing.T) {
|
|
t.Log("pressing 'd' for 5 seconds")
|
|
kb.Press(key.D)
|
|
for i := 0; i < 5; i++ {
|
|
t.Logf("\t%d...", 5-i)
|
|
time.Sleep(time.Second)
|
|
}
|
|
t.Logf("releasing")
|
|
kb.Press()
|
|
})
|
|
}
|