1{- We setup the environment to envoke certain terminals of interest.
2 - This assumes appropriate definitions exist in the current environment for the terminals of
5module VerifyUsingMockInput where
9import Graphics.Vty.Input.Data
11import Control.Concurrent
14import System.Posix.Env
18 = Bytes String -- | input sequence encoded as a string. Regardless, the input is read a byte at a time.
19 | Delay Int -- | millisecond delay
21type InputSpec = [InputEvent]
23type ExpectedSpec = [Event]
25exec_input_spec :: InputSpec -> Handle -> IO ()
26exec_input_spec input out_handle = forM_ input f
28 f (Bytes str) = hPutStr out_handle str >> hFlush out_handle
29 f (Delay t) = threadDelay (t*1000)
31assert_events_from_IO_reads :: InputSpec -> ExpectedSpec -> IO Result
32assert_events_from_IO_reads input events = undefined
34assert_events_from_input_block :: InputSpec -> ExpectedSpec -> Result
35assert_events_from_input_block input events = undefined
37verify_ansi_table_input_block_to_event :: Gen Result
38verify_ansi_table_input_block_to_event = do
39 Positive block_length <- arbitrary
40 block_event_pairs <- vectorOf block_length $ elements $ concat ansi_classify_table
41 let input = [Bytes $ concatMap fst block_event_pairs]
42 events = map (\(k,ms) -> EvKey k ms) $ map snd block_event_pairs
43 return $ assert_events_from_input_block input events
47 [ verify "basic input block to event translation" verify_ansi_table_input_block_to_event
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