2-- Module : Streamly.Test.Common
3-- Copyright : (c) 2020 Composewell Technologies
5-- License : BSD-3-Clause
6-- Maintainer : streamly@composewell.com
7-- Stability : experimental
10module Streamly.Test.Common
15import Control.Monad (when)
16import Control.Monad.IO.Class (MonadIO(..))
17import Data.List ((\\))
18#if __GLASGOW_HASKELL__ < 808
19import Data.Semigroup ((<>))
21import Test.QuickCheck (counterexample)
22import Test.QuickCheck.Monadic (PropertyM, assert, monitor)
26 => (a -> a -> Bool) -> a -> a -> PropertyM m ()
27equals eq stream list = do
28 when (not $ stream `eq` list) $
31 "stream " <> show stream
32 <> "\nlist " <> show list
34 assert (stream `eq` list)
37 :: (Show a, Eq a, MonadIO m)
38 => ([a] -> [a] -> Bool) -> [a] -> [a] -> PropertyM m ()
39listEquals eq stream list = do
40 when (not $ stream `eq` list) $ liftIO $ putStrLn $
41 "stream " <> show stream
42 <> "\nlist " <> show list
43 <> "\nstream \\\\ list " <> show (stream \\ list)
44 <> "\nlist \\\\ stream " <> show (list \\ stream)
45 when (not $ stream `eq` list) $
48 "stream " <> show stream
49 <> "\nlist " <> show list
50 <> "\nstream \\\\ list " <> show (stream \\ list)
51 <> "\nlist \\\\ stream " <> show (list \\ stream)
53 assert (stream `eq` list)
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