1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE RankNTypes #-}
13 , module Reflex.TestPlan
21import Reflex.Plan.Pure
22import Reflex.Plan.Reflex
27import Data.IntMap (IntMap)
35testAgreement :: TestCase -> IO Bool
36testAgreement (TestE p) = do
37 spider <- runSpiderHost $ runTestE p
38 let results = [("spider", spider)]
40 compareResult results (testEvent $ runPure p)
42testAgreement (TestB p) = do
43 spider <- runSpiderHost $ runTestB p
44 let results = [("spider", spider)]
46 compareResult results (testBehavior $ runPure p)
49compareResult :: (Show a, Eq a) => [(String, IntMap a)] -> IntMap a -> IO Bool
50compareResult results expected = fmap and $ forM results $ \(name, r) -> do
52 when (r /= expected) $ do
53 putStrLn ("Got: " ++ show (name, r))
54 putStrLn ("Expected: " ++ show expected)
55 return (r == expected)
58runTests :: [(String, TestCase)] -> IO ()
59runTests testCases = do
60 results <- forM testCases $ \(name, test) -> do
61 putStrLn $ "Test: " <> name
63 exitWith $ if and results
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