diff options
Diffstat (limited to 'specs')
| -rw-r--r-- | specs/Specs/FooSpec.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/specs/Specs/FooSpec.hs b/specs/Specs/FooSpec.hs index 4c5f640..3260ca9 100644 --- a/specs/Specs/FooSpec.hs +++ b/specs/Specs/FooSpec.hs @@ -1,6 +1,7 @@ module Specs.FooSpec where import Daffm.Action.Commands (parseCommand) +import Daffm.Configuration (parseKey) import Daffm.Event (matchKeySequence) import Daffm.Types import qualified Data.Map as Map @@ -75,3 +76,10 @@ test = do parseCommand "cmdline-set hello" `shouldBe` Just (CmdSetCmdline "hello") parseCommand "cmdline-set" `shouldBe` Just (CmdSetCmdline "") parseCommand "cmdline-set somespaces " `shouldBe` Just (CmdSetCmdline "somespaces ") + + describe "parseKey" $ do + context "when given keys" $ do + it "parses correctly" $ do + parseKey "gdl" `shouldBe` Just [K.KChar 'g', K.KChar 'd', K.KChar 'l'] + parseKey "<tab>g<cr>" `shouldBe` Just [K.KChar '\t', K.KChar 'g', K.KEnter] + parseKey "<esc>22" `shouldBe` Just [K.KEsc, K.KChar '2', K.KChar '2'] |
