1{-# LANGUAGE QuasiQuotes #-}
4import Graphics.Vty.Config
5import Graphics.Vty.Input.Events
8import qualified Data.ByteString.Char8 as B
11import Test.Framework.Providers.HUnit
12import Test.HUnit hiding (Test)
14exampleConfig :: B.ByteString
15exampleConfig = B.pack [s|
16-- comments should be ignored.
18askfjla dfasjdflk jasdlkfj asdfj -- lines failing parse should be ignored
19map _ "\ESC[1;3B" KDown [MAlt]
20map "xterm" "\ESC[1;3B" KDown [MAlt]
21map "xterm-256-color" "\ESC[1;3B" KDown [MAlt]
22debugLog "/tmp/vty-debug.txt"
25exampleConfigConfig :: Config
26exampleConfigConfig = defaultConfig
27 { debugLog = Just "/tmp/vty-debug.txt"
28 , inputMap = [ (Nothing, "\ESC[B", EvKey KUp [])
29 , (Nothing, "\ESC[1;3B", EvKey KDown [MAlt])
30 , (Just "xterm", "\ESC[1;3B", EvKey KDown [MAlt])
31 , (Just "xterm-256-color", "\ESC[1;3B", EvKey KDown [MAlt])
35exampleConfigParses :: IO ()
37 assertEqual "example config parses as expected"
39 (runParseConfig "exampleConfig" exampleConfig)
43 [ testCase "example config parses" $ exampleConfigParses
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list