sydtest-0.5.0.0: A modern testing framework for Haskell with good defaults and advanced testing features.
Safe HaskellNone
LanguageHaskell2010

Test.Syd.Modify

Description

This module defines functions for declaring different test settings

Synopsis

Declaring different test settings

modifyMaxSuccess :: (Int -> Int) -> TestDefM a b c -> TestDefM a b c Source #

modifyMaxSize :: (Int -> Int) -> TestDefM a b c -> TestDefM a b c Source #

modifyMaxShrinks :: (Int -> Int) -> TestDefM a b c -> TestDefM a b c Source #

data TestRunSettings Source #

Instances

Instances details
Show TestRunSettings Source # 
Instance details

Defined in Test.Syd.Run

Generic TestRunSettings Source # 
Instance details

Defined in Test.Syd.Run

Associated Types

type Rep TestRunSettings :: Type -> Type #

MonadReader TestRunSettings (TestDefM outers inner) Source # 
Instance details

Defined in Test.Syd.Def.TestDefM

Methods

ask :: TestDefM outers inner TestRunSettings #

local :: (TestRunSettings -> TestRunSettings) -> TestDefM outers inner a -> TestDefM outers inner a #

reader :: (TestRunSettings -> a) -> TestDefM outers inner a #

type Rep TestRunSettings Source # 
Instance details

Defined in Test.Syd.Run

type Rep TestRunSettings = D1 ('MetaData "TestRunSettings" "Test.Syd.Run" "sydtest-0.5.0.0-K7dy4zhWkke3Wv1xXG926d" 'False) (C1 ('MetaCons "TestRunSettings" 'PrefixI 'True) ((S1 ('MetaSel ('Just "testRunSettingSeed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SeedSetting) :*: (S1 ('MetaSel ('Just "testRunSettingMaxSuccess") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "testRunSettingMaxSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "testRunSettingMaxDiscardRatio") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "testRunSettingMaxShrinks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "testRunSettingGoldenStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "testRunSettingGoldenReset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))))

Declaring parallelism

sequential :: TestDefM a b c -> TestDefM a b c Source #

Declare that all tests below must be run sequentially

parallel :: TestDefM a b c -> TestDefM a b c Source #

Declare that all tests below may be run in parallel. (This is the default.)

Declaring randomisation order

Declaring flakiness

flaky :: Int -> TestDefM a b c -> TestDefM a b c Source #

Mark a test suite as "potentially flaky".

This will retry any test in the given test group up to the given number of tries, and pass a test if it passes once. The test output will show which tests were flaky.

WARNING: This is only a valid approach to dealing with test flakiness if it is true that tests never pass accidentally. In other words: tests using flaky must be guaranteed to fail every time if an error is introduced in the code, it should only be added to deal with accidental failures, never accidental passes.

notFlaky :: TestDefM a b c -> TestDefM a b c Source #