Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Delay = Delay {}
- genDelayWithPrecision :: Integer -> Gen DiffTime
- newtype SmallDelay = SmallDelay {}
- isSubsetProperty :: (Ord a, Show a) => String -> Set a -> Set a -> Property
- disjointSetsProperty :: (Ord a, Show a) => String -> Set a -> Set a -> Property
- arbitrarySubset :: Ord a => Set a -> Gen (Set a)
- shrinkVector :: (a -> [a]) -> [a] -> [[a]]
- newtype ShrinkCarefully a = ShrinkCarefully a
- prop_shrink_nonequal :: (Arbitrary a, Eq a, Show a) => ShrinkCarefully a -> Property
- prop_shrink_valid :: (Arbitrary a, Show a, Testable prop) => (a -> prop) -> ShrinkCarefully a -> Property
- data WithName name event = WithName {}
- data WithTime event = WithTime {}
- tracerWithName :: forall name (m :: Type -> Type) a. name -> Tracer m (WithName name a) -> Tracer m a
- tracerWithTime :: forall (m :: Type -> Type) a. MonadMonotonicTime m => Tracer m (WithTime a) -> Tracer m a
- tracerWithTimeName :: forall (m :: Type -> Type) name a. MonadMonotonicTime m => name -> Tracer m (WithTime (WithName name a)) -> Tracer m a
- swapTimeWithName :: WithTime (WithName name b) -> WithName name (WithTime b)
- swapNameWithTime :: WithName name (WithTime b) -> WithTime (WithName name b)
- splitWithNameTrace :: Ord name => Trace r (WithName name b) -> Trace r [WithName name b]
- debugTracer :: forall a (m :: Type -> Type). (Show a, Applicative m) => Tracer m a
- sayTracer :: forall a (m :: Type -> Type). (Show a, MonadSay m) => Tracer m a
- nightlyTest :: TestTree -> TestTree
- ignoreTest :: TestTree -> TestTree
- renderRanges :: Int -> Int -> String
Arbitrary Delays
newtype SmallDelay Source #
Instances
Set properties
QuickCheck Utils
arbitrarySubset :: Ord a => Set a -> Gen (Set a) Source #
Pick a subset of a set, using a 50:50 chance for each set element.
shrinkVector :: (a -> [a]) -> [a] -> [[a]] Source #
Like shrinkList
but only shrink the elems, don't drop elements.
Useful when you want a custom strategy for dropping elements.
newtype ShrinkCarefully a Source #
Instances
(Eq a, Arbitrary a) => Arbitrary (ShrinkCarefully a) Source # | |
Defined in Ouroboros.Network.Testing.Utils arbitrary :: Gen (ShrinkCarefully a) # shrink :: ShrinkCarefully a -> [ShrinkCarefully a] # | |
Show a => Show (ShrinkCarefully a) Source # | |
Defined in Ouroboros.Network.Testing.Utils showsPrec :: Int -> ShrinkCarefully a -> ShowS # show :: ShrinkCarefully a -> String # showList :: [ShrinkCarefully a] -> ShowS # | |
Eq a => Eq (ShrinkCarefully a) Source # | |
Defined in Ouroboros.Network.Testing.Utils (==) :: ShrinkCarefully a -> ShrinkCarefully a -> Bool # (/=) :: ShrinkCarefully a -> ShrinkCarefully a -> Bool # |
prop_shrink_nonequal :: (Arbitrary a, Eq a, Show a) => ShrinkCarefully a -> Property Source #
prop_shrink_valid :: (Arbitrary a, Show a, Testable prop) => (a -> prop) -> ShrinkCarefully a -> Property Source #
Check that each shrink satisfies some invariant or validity condition.
Tracing Utils
tracerWithName :: forall name (m :: Type -> Type) a. name -> Tracer m (WithName name a) -> Tracer m a Source #
tracerWithTime :: forall (m :: Type -> Type) a. MonadMonotonicTime m => Tracer m (WithTime a) -> Tracer m a Source #
tracerWithTimeName :: forall (m :: Type -> Type) name a. MonadMonotonicTime m => name -> Tracer m (WithTime (WithName name a)) -> Tracer m a Source #
splitWithNameTrace :: Ord name => Trace r (WithName name b) -> Trace r [WithName name b] Source #
Split Trace events into separate traces indexed by a given name.
Tracers
debugTracer :: forall a (m :: Type -> Type). (Show a, Applicative m) => Tracer m a Source #
Tasty Utils
nightlyTest :: TestTree -> TestTree Source #
ignoreTest :: TestTree -> TestTree #
Prevents the tests from running and reports them as succeeding.
This may be be desireable as an alternative to commenting out the tests. This way, they are still typechecked (preventing bitrot), and the test report lists them, which serves as a reminder that there are ignored tests.
Note that any setup/teardown actions executed by withResource
are still executed. You can bypass this manually as in the following example:
askOption $ \(MyFlag b) -> if b then withResource mytest else ignoreTest . mytest $ return junkvalue