Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Delay = Delay { }
- genDelayWithPrecision :: Integer -> Gen DiffTime
- newtype SmallDelay = SmallDelay { }
- arbitrarySubset :: Ord a => Set a -> Gen ( Set a)
- shrinkVector :: (a -> [a]) -> [a] -> [[a]]
- prop_shrink_valid :: ( Arbitrary a, Show a) => (a -> Bool ) -> Fixed a -> Property
- prop_shrink_nonequal :: ( Arbitrary a, Eq a) => Fixed a -> Property
- data WithName name event = WithName { }
- data WithTime event = WithTime { }
- tracerWithName :: name -> Tracer m ( WithName name a) -> Tracer m a
- tracerWithTime :: MonadMonotonicTime m => Tracer m ( WithTime a) -> Tracer m a
- tracerWithTimeName :: 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 :: ( Show a, Applicative m) => Tracer m a
- sayTracer :: ( Show a, MonadSay m) => Tracer m a
- nightlyTest :: TestTree -> TestTree
- ignoreTest :: TestTree -> TestTree
- renderRanges :: Int -> Int -> String
Arbitrary Delays
newtype SmallDelay Source #
Instances
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.
prop_shrink_valid :: ( Arbitrary a, Show a) => (a -> Bool ) -> Fixed a -> Property Source #
Check that each shrink satisfies some invariant or validity condition.
prop_shrink_nonequal :: ( Arbitrary a, Eq a) => Fixed a -> Property Source #
The
shrink
function needs to give a valid value that is
smaller
than
the original, otherwise the shrinking procedure is not well-founded and can
cycle.
This property does not check size, as that would need significant extra infrastructure to define an appropriate measure. Instead this property simply checks each shrink is not the same as the original. This catches simple 1-cycles, but not bigger cycles. These are fortunately the most common case, so it is still a useful property in practice.
Tracing Utils
tracerWithTime :: MonadMonotonicTime m => Tracer m ( WithTime a) -> Tracer m a Source #
tracerWithTimeName :: 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 :: ( Show a, Applicative m) => Tracer m a Source #
Tasty Utils
nightlyTest :: TestTree -> TestTree Source #
ignoreTest :: TestTree -> TestTree Source #
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