From f51fbc728e4b731372e39ba19c38a35ef58fe71a Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 21 Dec 2024 22:18:50 +0530 Subject: Add action repetition --- specs/Specs/AppEventSpec.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'specs/Specs/AppEventSpec.hs') diff --git a/specs/Specs/AppEventSpec.hs b/specs/Specs/AppEventSpec.hs index 390fbc2..db292a7 100644 --- a/specs/Specs/AppEventSpec.hs +++ b/specs/Specs/AppEventSpec.hs @@ -86,7 +86,6 @@ test = do it "calls key input handler" $ do eventHandler (mkKeyboardEvent SDL.KeycodeA SDL.Pressed defaultMod) `shouldBe` Just (HandleKeyInput SDL.KeycodeA) eventHandler (mkKeyboardEvent SDL.KeycodeQ SDL.Pressed defaultMod) `shouldBe` Just (HandleKeyInput SDL.KeycodeQ) - eventHandler (mkKeyboardEvent SDL.Keycode9 SDL.Pressed defaultMod) `shouldBe` Just (HandleKeyInput SDL.Keycode9) context "when shift key is pressed" $ do it "enables shift" $ do @@ -97,3 +96,8 @@ test = do it "disabled shift" $ do let action = eventHandler $ mkKeyboardEvent SDL.KeycodeRShift SDL.Released defaultMod action `shouldBe` Just (UpdateShiftState False) + + context "when digit is pressed" $ do + it "sets repetition count" $ do + let action = eventHandler $ mkKeyboardEvent SDL.Keycode9 SDL.Pressed defaultMod + action `shouldBe` Just (UpdateRepetition 9) -- cgit v1.3.1