Skip to content

Commit

Permalink
Added setupAroundWithAll function
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOddler authored and Tom Sydney Kerckhove committed Jul 28, 2023
1 parent 1677373 commit a3ba5f3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sydtest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.15.1.0] - 2023-07-28

* `setupAroundWithAll`: so it's easier to use multiple outer resources to provide an inner resource, without the need of extra type annotation.

## [0.15.0.0] - 2023-04-08

* `DefBeforeAllWithNode`: so that `beforeAllWith` can be defined in terms of it and have better parallelism properties.
Expand Down
1 change: 1 addition & 0 deletions sydtest/CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NorfairKing
igrep
mrcjkb
L7R7
TheOddler
2 changes: 1 addition & 1 deletion sydtest/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}:
mkDerivation {
pname = "sydtest";
version = "0.15.0.0";
version = "0.15.1.0";
src = ./.;
libraryHaskellDepends = [
async autodocodec autodocodec-yaml base bytestring containers dlist
Expand Down
2 changes: 1 addition & 1 deletion sydtest/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sydtest
version: 0.15.0.0
version: 0.15.1.0
github: "NorfairKing/sydtest"
license: OtherLicense
license-file: LICENSE.md
Expand Down
5 changes: 5 additions & 0 deletions sydtest/src/Test/Syd/Def/SetupFunc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ setupAroundWith' f = aroundWith' $ \takeBoth outer oldInner ->
let SetupFunc provideNewInner = f outer oldInner
in provideNewInner $ \newInner -> takeBoth outer newInner

-- | 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
setupAroundWithAll :: (HList outers -> oldInner -> SetupFunc newInner) -> TestDefM outers newInner result -> TestDefM outers oldInner result
setupAroundWithAll = setupAroundWith'

-- | Use 'aroundAll' with a 'SetupFunc'
setupAroundAll ::
SetupFunc outer ->
Expand Down
2 changes: 1 addition & 1 deletion sydtest/sydtest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: sydtest
version: 0.15.0.0
version: 0.15.1.0
synopsis: A modern testing framework for Haskell with good defaults and advanced testing features.
description: A modern testing framework for Haskell with good defaults and advanced testing features. Sydtest aims to make the common easy and the hard possible. See https://github.com/NorfairKing/sydtest#readme for more information.
category: Testing
Expand Down

0 comments on commit a3ba5f3

Please sign in to comment.