diff --git a/src/device/output/keyboard_test.go b/src/device/output/keyboard_test.go index d0d8d95..bdf4feb 100644 --- a/src/device/output/keyboard_test.go +++ b/src/device/output/keyboard_test.go @@ -9,18 +9,34 @@ import ( "time" ) +func TestTwoKeyboards(t *testing.T) { + kb1 := output.NewKeyboard() + t.Cleanup(kb1.Close) + kb2 := output.NewKeyboard() + t.Cleanup(kb2.Close) + + kb1.Press(key.D) + kb2.Press(key.W) + t.Log("pressing 'w' and 'd' over 2 keyboards for 5 seconds") + for i := 0; i < 5; i++ { + t.Logf("\t%d...", 5-i) + time.Sleep(time.Second) + } + t.Logf("releasing") + kb1.Press() + kb2.Press() +} + 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() - }) + 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() }