Hoogle Search

Within LTS Haskell 24.67 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. aroundAll :: forall outer (otherOuters :: [Type]) inner result . ((outer -> IO ()) -> IO ()) -> TestDefM (outer ': otherOuters) inner result -> TestDefM otherOuters inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before and/or after all spec items in group, to provide access to a resource a. See the FOOTGUN note in the docs for around_.

  2. aroundAllWith :: forall newOuter oldOuter (otherOuters :: [Type]) inner result . ((newOuter -> IO ()) -> oldOuter -> IO ()) -> TestDefM (newOuter ': (oldOuter ': otherOuters)) inner result -> TestDefM (oldOuter ': otherOuters) inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before and/or after all spec items in a group to provide access to a resource a while using a resource b See the FOOTGUN note in the docs for around_.

  3. aroundAll_ :: forall (outers :: [Type]) inner result . (IO () -> IO ()) -> TestDefM outers inner result -> TestDefM outers inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before and/or after all spec items in a group without accessing any resources.

    FOOTGUN

    This combinator gives the programmer a lot of power. In fact, it gives the programmer enough power to break the test framework. Indeed, you can provide a wrapper function that just _doesn't_ run the function like this:
    spec :: Spec
    spec = do
    let don'tDo :: IO () -> IO ()
    don'tDo _ = pure ()
    aroundAll_ don'tDo $ do
    it "should pass" True
    
    During execution, you'll then get an error like this:
    thread blocked indefinitely in an MVar operation
    
    The same problem exists when using around_. Something even more pernicious goes wrong when you run the given action more than once like this:
    spec :: Spec
    spec = do
    let doTwice :: IO () -> IO ()
    doTwice f = f >> f
    aroundAll_ doTwice $ do
    it "should pass" True
    
    In this case, the test will "just work", but it will be executed twice even if the output reports that it only passed once. Note: If you're interested in fixing this, talk to me, but only after GHC has gotten impredicative types because that will likely be a requirement.

  4. beforeAll :: forall outer (otherOuters :: [Type]) inner result . IO outer -> TestDefM (outer ': otherOuters) inner result -> TestDefM otherOuters inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before all spec items in a group, to set up an outer resource a.

  5. beforeAllWith :: forall previousOuter newOuter (otherOuters :: [Type]) inner result . (previousOuter -> IO newOuter) -> TestDefM (newOuter ': (previousOuter ': otherOuters)) inner result -> TestDefM (previousOuter ': otherOuters) inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before all spec items in a group, to set up an outer resource b by using the outer resource a.

  6. beforeAll_ :: forall (outers :: [Type]) inner result . IO () -> TestDefM outers inner result -> TestDefM outers inner result

    sydtest Test.Syd.Def.AroundAll

    Run a custom action before all spec items in a group without setting up any outer resources.

  7. setupAroundAll :: forall outer (outers :: [Type]) inner result . SetupFunc outer -> TestDefM (outer ': outers) inner result -> TestDefM outers inner result

    sydtest Test.Syd.Def.SetupFunc

    Use aroundAll with a SetupFunc

  8. setupAroundAllWith :: forall oldOuter newOuter (outers :: [Type]) inner result . (oldOuter -> SetupFunc newOuter) -> TestDefM (newOuter ': (oldOuter ': outers)) inner result -> TestDefM (oldOuter ': outers) inner result

    sydtest Test.Syd.Def.SetupFunc

    Use aroundAllWith with a SetupFunc

  9. setupAroundWithAll :: forall (outers :: [Type]) oldInner newInner result . (HList outers -> oldInner -> SetupFunc newInner) -> TestDefM outers newInner result -> TestDefM outers oldInner result

    sydtest Test.Syd.Def.SetupFunc

    Use all outer resources and the inner resource to provide a new inner resource This is a more constrained version of setupAroundWith' to more easily allow providing an inner resource based on multiple outer resources

  10. itWithAll :: forall test (outers :: [Type]) inner . (HasCallStack, IsTest test, Arg1 test ~ HList outers, Arg2 test ~ inner) => String -> test -> TestDefM outers inner ()

    sydtest Test.Syd.Def.Specify

    Declare a test that uses all outer resources You will most likely never need this function, but in case you do: Note that this will always require a type annotation, along with the GADTs and ScopedTypeVariables extensions.

    Example usage

    beforeAll (pure 'a') $ beforeAll (pure 5) $
    itWithAll "example" $
    \(HCons c (HCons i HNil) :: HList '[Char, Int]) () ->
    (c, i) `shouldeBe` ('a', 5)
    

Page 338 of many | Previous | Next