From 7202fef15d8bd241cfe0abeef1e2a35d10a853d8 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 2 Mar 2023 09:27:30 -0700 Subject: [PATCH] confirmed keypress works on mac and mario runs right --- src/device/output/keyboard_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/device/output/keyboard_test.go b/src/device/output/keyboard_test.go index 5a54281..d0d8d95 100644 --- a/src/device/output/keyboard_test.go +++ b/src/device/output/keyboard_test.go @@ -13,12 +13,14 @@ func TestKeyboardIntegration(t *testing.T) { kb := output.NewKeyboard() t.Cleanup(kb.Close) - t.Log("pressing 'a' for 5 seconds") - kb.Press(key.A) - for i := 0; i < 5; i++ { - t.Logf("\t%d...", 5-i) - time.Sleep(time.Second) - } - t.Logf("releasing") - kb.Press() + 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() + }) }