{-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Test.Sandwich.Formatters.Common.Count where import Test.Sandwich.Types.RunTree import Test.Sandwich.Types.Spec countWhere :: (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int countWhere :: forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int countWhere forall ctx. RunNodeWithStatus ctx s l t -> Bool p [RunNodeWithStatus context s l t] rts = [Int] -> Int forall a. Num a => [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a sum ([Int] -> Int) -> [Int] -> Int forall a b. (a -> b) -> a -> b $ (RunNodeWithStatus context s l t -> Int) -> [RunNodeWithStatus context s l t] -> [Int] forall a b. (a -> b) -> [a] -> [b] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap ((forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> RunNodeWithStatus context s l t -> Int forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> RunNodeWithStatus context s l t -> Int countWhere' RunNodeWithStatus ctx s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p) [RunNodeWithStatus context s l t] rts where countWhere' :: (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> RunNodeWithStatus context s l t -> Int countWhere' :: forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> RunNodeWithStatus context s l t -> Int countWhere' forall ctx. RunNodeWithStatus ctx s l t -> Bool p' rt :: RunNodeWithStatus context s l t rt@(RunNodeIt {}) = if RunNodeWithStatus context s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' RunNodeWithStatus context s l t rt then Int 1 else Int 0 countWhere' forall ctx. RunNodeWithStatus ctx s l t -> Bool p' rt :: RunNodeWithStatus context s l t rt@(RunNodeIntroduce {[RunNodeWithStatus (LabelValue lab intro :> context) s l t] ExampleT context IO intro RunNodeCommonWithStatus s l t intro -> ExampleT context IO () runNodeCommon :: RunNodeCommonWithStatus s l t runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t] runNodeAlloc :: ExampleT context IO intro runNodeCleanup :: intro -> ExampleT context IO () runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeChildrenAugmented :: () runNodeAlloc :: () runNodeCleanup :: () ..}) = (if RunNodeWithStatus context s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' RunNodeWithStatus context s l t rt then Int 1 else Int 0) Int -> Int -> Int forall a. Num a => a -> a -> a + (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus (LabelValue lab intro :> context) s l t] -> Int forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int countWhere RunNodeWithStatus ctx s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' [RunNodeWithStatus (LabelValue lab intro :> context) s l t] runNodeChildrenAugmented countWhere' forall ctx. RunNodeWithStatus ctx s l t -> Bool p' rt :: RunNodeWithStatus context s l t rt@(RunNodeIntroduceWith {[RunNodeWithStatus (LabelValue lab intro :> context) s l t] RunNodeCommonWithStatus s l t (intro -> ExampleT context IO [Result]) -> ExampleT context IO () runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeChildrenAugmented :: () runNodeCommon :: RunNodeCommonWithStatus s l t runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t] runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO () runNodeIntroduceAction :: () ..}) = (if RunNodeWithStatus context s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' RunNodeWithStatus context s l t rt then Int 1 else Int 0) Int -> Int -> Int forall a. Num a => a -> a -> a + (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus (LabelValue lab intro :> context) s l t] -> Int forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int countWhere RunNodeWithStatus ctx s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' [RunNodeWithStatus (LabelValue lab intro :> context) s l t] runNodeChildrenAugmented countWhere' forall ctx. RunNodeWithStatus ctx s l t -> Bool p' RunNodeWithStatus context s l t rt = (if RunNodeWithStatus context s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' RunNodeWithStatus context s l t rt then Int 1 else Int 0) Int -> Int -> Int forall a. Num a => a -> a -> a + (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int forall s l t context. (forall ctx. RunNodeWithStatus ctx s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int countWhere RunNodeWithStatus ctx s l t -> Bool forall ctx. RunNodeWithStatus ctx s l t -> Bool p' (RunNodeWithStatus context s l t -> [RunNodeWithStatus context s l t] forall s l t context. RunNodeWithStatus context s l t -> [RunNodeWithStatus context s l t] runNodeChildren RunNodeWithStatus context s l t rt) isItBlock :: RunNodeWithStatus context s l t -> Bool isItBlock (RunNodeIt {}) = Bool True isItBlock RunNodeWithStatus context s l t _ = Bool False isRunningItBlock :: RunNodeWithStatus context Status l t -> Bool isRunningItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Running {})})}) = Bool True isRunningItBlock RunNodeWithStatus context Status l t _ = Bool False isSuccessItBlock :: RunNodeWithStatus context Status l t -> Bool isSuccessItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=Result Success})})}) = Bool True isSuccessItBlock RunNodeWithStatus context Status l t _ = Bool False isPendingItBlock :: RunNodeWithStatus context Status l t -> Bool isPendingItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure (Pending {}))})})}) = Bool True isPendingItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure {})})})}) = Bool False isPendingItBlock RunNodeWithStatus context Status l t _ = Bool False isFailedItBlock :: RunNodeWithStatus context Status l t -> Bool isFailedItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure (Pending {}))})})}) = Bool False isFailedItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure {})})})}) = Bool True isFailedItBlock RunNodeWithStatus context Status l t _ = Bool False isFailedBlock :: RunNodeWithStatus context Status l t -> Bool isFailedBlock (RunNodeWithStatus context Status l t -> RunNodeCommonWithStatus Status l t forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon -> (RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure (Pending {}))})})) = Bool False isFailedBlock (RunNodeWithStatus context Status l t -> RunNodeCommonWithStatus Status l t forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon -> (RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {statusResult :: Status -> Result statusResult=(Failure {})})})) = Bool True isFailedBlock RunNodeWithStatus context Status l t _ = Bool False isDoneItBlock :: RunNodeWithStatus context Status l t -> Bool isDoneItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(Done {})})}) = Bool True isDoneItBlock RunNodeWithStatus context Status l t _ = Bool False isNotStartedItBlock :: RunNodeWithStatus context Status l t -> Bool isNotStartedItBlock (RunNodeIt {runNodeCommon :: forall s l t context. RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t runNodeCommon=(RunNodeCommonWithStatus {runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s runTreeStatus=(NotStarted {})})}) = Bool True isNotStartedItBlock RunNodeWithStatus context Status l t _ = Bool False