on master help sign in
add test demonstrating current parse failure
commit24b6a9d7412a35fa66c0b9caf681a62ad28ca6f5 authorCorey O'Connor <corey@ooyala.com> dateFri 31 Jan 2014, 01:26 (13 years ago) parentccb1b24
1 file changed+17−4
test/VerifyUsingMockInput.hs+17−4
test/VerifyUsingMockInput.hs+17−4
@@ -186,15 +186,28 @@ verify_full_syn_input_to_event = forAll $ \(InputBlocksUsingTable gen) ->
186186 input = intersperse (Delay test_key_delay) keydowns ++ [Delay test_key_delay]
187187 assert_events_from_syn_input table input events
188188
189+verify_full_syn_input_to_event_2x :: Property IO
190+verify_full_syn_input_to_event_2x = forAll $ \(InputBlocksUsingTable gen) ->
191+ forEachOf terminals_of_interest $ \term_name -> monadic $ do
192+ term <- setupTerm term_name
193+ let table = classify_table_for_term term_name term
194+ input_seq = gen table
195+ events = concatMap ((\s -> [s,s]) . snd) input_seq
196+ keydowns = map (Bytes . (\s -> s ++ s) . fst) input_seq
197+ input = intersperse (Delay test_key_delay) keydowns ++ [Delay test_key_delay]
198+ assert_events_from_syn_input table input events
199+
189200main :: IO ()
190201main = defaultMain
191− [ testProperty "synthesized typing from single visible chars translates to expected events"
202+ [ testProperty "synthesized typing of single visible chars translates to expected events"
192203 verify_visible_syn_input_to_event
193− , testProperty "synthesized typing from keys from capabilities tables translates to expected events"
204+ , testProperty "synthesized typing of keys from capabilities tables translates to expected events"
194205 verify_caps_syn_input_to_event
195− , testProperty "synthesized typing from hard coded special keys translates to expected events"
206+ , testProperty "synthesized typing of hard coded special keys translates to expected events"
196207 verify_special_syn_input_to_event
197− , testProperty "synthesized typing from any key in the table translates to expected events"
208+ , testProperty "synthesized typing of any key in the table translates to its paired event"
198209 verify_full_syn_input_to_event
210+ , testProperty "synthesized typing of 2x any key in the table translates to 2x paired event"
211+ verify_full_syn_input_to_event_2x
199212 ]
200213