2{-# LANGUAGE RecordWildCards #-}
3{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE TypeSynonymInstances #-}
6{-# LANGUAGE FlexibleInstances #-}
7{-# LANGUAGE StandaloneDeriving #-}
8{-# LANGUAGE DisambiguateRecordFields #-}
9{-# LANGUAGE NamedFieldPuns #-}
10module Verify ( module Verify
11 , module Control.DeepSeq
12 , module Test.QuickCheck
24import Distribution.TestSuite hiding ( Result(..) )
25import qualified Distribution.TestSuite as TS
27import Test.QuickCheck hiding ( Result(..) )
28import qualified Test.QuickCheck as QC
29import Test.QuickCheck.Property hiding ( Result(..) )
30import qualified Test.QuickCheck.Property as Prop
31import Test.QuickCheck.Monadic ( monadicIO )
33import qualified Codec.Binary.UTF8.String as UTF8
36import Control.Monad.State.Strict
41import Numeric ( showHex )
46verify :: Testable t => String -> t -> Test
47verify test_name p = Test $ TestInstance
50 qc_result <- quickCheckResult p
52 QC.Success {..} -> return $ Finished TS.Pass
53 _ -> return $ Finished $ TS.Fail "TODO(corey): add failure message"
56 , setOption = \_ _ -> Left "no options supported"
59data SingleColumnChar = SingleColumnChar Char
62instance Arbitrary SingleColumnChar where
63 arbitrary = elements $ map SingleColumnChar [toEnum 0x21 .. toEnum 0x7E]
65data DoubleColumnChar = DoubleColumnChar Char
68instance Show DoubleColumnChar where
69 show (DoubleColumnChar c) = "(0x" ++ showHex (fromEnum c) "" ++ ") ->" ++ UTF8.encodeString [c]
71instance Arbitrary DoubleColumnChar where
72 arbitrary = elements $ map DoubleColumnChar $
73 [ toEnum 0x3040 .. toEnum 0x3098 ]
74 ++ [ toEnum 0x309B .. toEnum 0xA4CF ]
76liftIOResult :: Testable prop => IO prop -> Property
77liftIOResult = morallyDubiousIOProperty
79#if __GLASGOW_HASKELL__ <= 701
80instance Random Word where
82 let (i :: Int, g') = random g
85 let (i :: Int, g') = randomR (fromEnum l,fromEnum h) g
90 Bench :: forall v . NFData v => IO v -> (v -> IO ()) -> Bench
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