git.iko.soy/servant-quickcheck
on c93bd5a help sign in
.travis.yml+42−40
since splitsnapshots
unifiedsplit
@@ -2,17 +2,11 @@
2#
2#
3# haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
3# haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
4#
4#
5−# To regenerate the script (for example after adjusting tested-with) run
6−#
7−# haskell-ci regenerate
8−#
9# For more information, see https://github.com/haskell-CI/haskell-ci
5# For more information, see https://github.com/haskell-CI/haskell-ci
10#
6#
11−# version: 0.10.1
7+# version: 0.5.20190908
12#
8#
13−version: ~> 1.0
14language: c
9language: c
15−os: linux
16dist: xenial
10dist: xenial
17git:
11git:
18 # whether to recursively clone submodules
12 # whether to recursively clone submodules
@@ -24,7 +18,6 @@ cache:
24 directories:
18 directories:
25 - $HOME/.cabal/packages
19 - $HOME/.cabal/packages
26 - $HOME/.cabal/store
20 - $HOME/.cabal/store
27− - $HOME/.hlint
28before_cache:
21before_cache:
29 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
22 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
30 # remove files that are regenerated by 'cabal update'
23 # remove files that are regenerated by 'cabal update'
@@ -34,23 +27,18 @@ before_cache:
34 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
27 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
35 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
28 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
36 - rm -rfv $CABALHOME/packages/head.hackage
29 - rm -rfv $CABALHOME/packages/head.hackage
37−jobs:
30+matrix:
38 include:
31 include:
39− - compiler: ghc-8.8.3
32+ - compiler: ghc-8.8.1
40− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.2"]}}
33+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
41− os: linux
42 - compiler: ghc-8.6.5
34 - compiler: ghc-8.6.5
43− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.2"]}}
35+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
44− os: linux
45 - compiler: ghc-8.4.4
36 - compiler: ghc-8.4.4
46− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.2"]}}
37+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
47− os: linux
48 - compiler: ghc-8.2.2
38 - compiler: ghc-8.2.2
49− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.2"]}}
39+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
50− os: linux
51 - compiler: ghc-8.0.2
40 - compiler: ghc-8.0.2
52− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.2"]}}
41+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
53− os: linux
54before_install:
42before_install:
55 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
43 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
56 - WITHCOMPILER="-w $HC"
44 - WITHCOMPILER="-w $HC"
@@ -63,8 +51,29 @@ before_install:
63 - TOP=$(pwd)
51 - TOP=$(pwd)
64 - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
52 - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
65 - echo $HCNUMVER
53 - echo $HCNUMVER
66− - CABAL="$CABAL -vnormal+nowrap"
54+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
67 - set -o pipefail
55 - set -o pipefail
56+ - |
57+ echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
58+ echo 'BEGIN { state = "output"; }' >> .colorful.awk
59+ echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
60+ echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
61+ echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
62+ echo ' if (state == "cabal") {' >> .colorful.awk
63+ echo ' print blue($0)' >> .colorful.awk
64+ echo ' } else {' >> .colorful.awk
65+ echo ' print $0' >> .colorful.awk
66+ echo ' }' >> .colorful.awk
67+ echo '}' >> .colorful.awk
68+ - cat .colorful.awk
69+ - |
70+ color_cabal_output () {
71+ awk -f $TOP/.colorful.awk
72+ }
73+ - echo text | color_cabal_output
74+install:
75+ - ${CABAL} --version
76+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
68 - TEST=--enable-tests
77 - TEST=--enable-tests
69 - BENCH=--enable-benchmarks
78 - BENCH=--enable-benchmarks
70 - HEADHACKAGE=false
79 - HEADHACKAGE=false
@@ -85,9 +94,6 @@ before_install:
85 echo " prefix: $CABALHOME" >> $CABALHOME/config
94 echo " prefix: $CABALHOME" >> $CABALHOME/config
86 echo "repository hackage.haskell.org" >> $CABALHOME/config
95 echo "repository hackage.haskell.org" >> $CABALHOME/config
87 echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
96 echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
88−install:
89− - ${CABAL} --version
90− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
91 - |
97 - |
92 echo "program-default-options" >> $CABALHOME/config
98 echo "program-default-options" >> $CABALHOME/config
93 echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
99 echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
@@ -99,22 +105,20 @@ install:
99 - touch cabal.project
105 - touch cabal.project
100 - |
106 - |
101 echo "packages: ." >> cabal.project
107 echo "packages: ." >> cabal.project
102− - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
103− - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
104 - |
108 - |
105 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
109 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
106 - cat cabal.project || true
110 - cat cabal.project || true
107 - cat cabal.project.local || true
111 - cat cabal.project.local || true
108 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
112 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
109− - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
113+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
110 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
114 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
111 - rm cabal.project.freeze
115 - rm cabal.project.freeze
112− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
116+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
113− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
117+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
114script:
118script:
115 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
119 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
116 # Packaging...
120 # Packaging...
117− - ${CABAL} v2-sdist all
121+ - ${CABAL} v2-sdist all | color_cabal_output
118 # Unpacking...
122 # Unpacking...
119 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
123 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
120 - cd ${DISTDIR} || false
124 - cd ${DISTDIR} || false
@@ -126,33 +130,31 @@ script:
126 - touch cabal.project
130 - touch cabal.project
127 - |
131 - |
128 echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
132 echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
129− - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
130− - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
131 - |
133 - |
132 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
134 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
133 - cat cabal.project || true
135 - cat cabal.project || true
134 - cat cabal.project.local || true
136 - cat cabal.project.local || true
135 # Building...
137 # Building...
136 # this builds all libraries and executables (without tests/benchmarks)
138 # this builds all libraries and executables (without tests/benchmarks)
137− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
139+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
138 # Building with tests and benchmarks...
140 # Building with tests and benchmarks...
139 # build & run tests, build benchmarks
141 # build & run tests, build benchmarks
140− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
142+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
141 # Testing...
143 # Testing...
142− - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
144+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
143 # cabal check...
145 # cabal check...
144 - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
146 - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
145 # haddock...
147 # haddock...
146− - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
148+ - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output
147 # Building without installed constraints for packages in global-db...
149 # Building without installed constraints for packages in global-db...
148 - rm -f cabal.project.local
150 - rm -f cabal.project.local
149− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
151+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
150 # Constraint sets
152 # Constraint sets
151 - rm -rf cabal.project.local
153 - rm -rf cabal.project.local
152 # Constraint set base-compat-0.10
154 # Constraint set base-compat-0.10
153− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all
155+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all | color_cabal_output
154 # Constraint set base-compat-0.11
156 # Constraint set base-compat-0.11
155− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all
157+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all | color_cabal_output
156
158
157−# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
159+# REGENDATA ["--config=cabal.haskell-ci","servant-quickcheck.cabal"]
158# EOF
160# EOF
CHANGELOG.yaml+3−12
@@ -1,19 +1,10 @@
1releases:
1releases:
2− - version: "0.0.9.0"
3− changes:
4− - description: "Support servant-0.15 (#65)"
5− authors: fizruk
6− date: 2020-06-25
7−
8− - description: "Relax constraints for GHC 8.10 (#70)"
9− authors: felixmulder
10− date: 2020-06-20
11
2
12− - version: "0.0.8.0"
3+ - version: "0.8"
13 changes:
4 changes:
14− - description: Support for servant-0.17
5+ - description: Support GHC-8.8. Allow newer versions of other dependencies.
15 authors: phadej
6 authors: phadej
16− date: 2019-01-23
7+ date: 2019-09-15
17
8
18 - version: "0.0.7.3"
9 - version: "0.0.7.3"
19 changes:
10 changes:
cabal.project−2
@@ -1,4 +1,2 @@
1packages: .
1packages: .
2tests: true
2tests: true
3−
4−allow-newer: servant-blaze:servant
servant-quickcheck.cabal+9−9
@@ -1,5 +1,5 @@
1name: servant-quickcheck
1name: servant-quickcheck
2−version: 0.0.9.1
2+version: 0.0.8
3synopsis: QuickCheck entire APIs
3synopsis: QuickCheck entire APIs
4description:
4description:
5 This packages provides QuickCheck properties that are tested across an entire
5 This packages provides QuickCheck properties that are tested across an entire
@@ -13,7 +13,7 @@ category: Web
13build-type: Simple
13build-type: Simple
14cabal-version: >=1.10
14cabal-version: >=1.10
15extra-source-files: CHANGELOG.yaml
15extra-source-files: CHANGELOG.yaml
16−tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.3
16+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.1
17
17
18source-repository head
18source-repository head
19 type: git
19 type: git
@@ -35,28 +35,28 @@ library
35
35
36 build-depends:
36 build-depends:
37 aeson >=0.8 && <2
37 aeson >=0.8 && <2
38− , base >=4.9 && <4.15
38+ , base >=4.9 && <4.14
39 , base-compat-batteries >=0.10.1 && <0.12
39 , base-compat-batteries >=0.10.1 && <0.12
40 , bytestring >=0.10 && <0.11
40 , bytestring >=0.10 && <0.11
41 , case-insensitive >=1.2 && <1.3
41 , case-insensitive >=1.2 && <1.3
42 , clock >=0.7 && <0.9
42 , clock >=0.7 && <0.9
43 , data-default-class >=0.0 && <0.2
43 , data-default-class >=0.0 && <0.2
44 , hspec >=2.5.6 && <2.8
44 , hspec >=2.5.6 && <2.8
45− , http-client >=0.4.30 && <0.8
45+ , http-client >=0.4.30 && <0.7
46 , http-media >=0.6 && <0.9
46 , http-media >=0.6 && <0.9
47 , http-types >=0.8 && <0.13
47 , http-types >=0.8 && <0.13
48 , mtl >=2.1 && <2.3
48 , mtl >=2.1 && <2.3
49 , pretty >=1.1 && <1.2
49 , pretty >=1.1 && <1.2
50 , process >=1.2 && <1.7
50 , process >=1.2 && <1.7
51− , QuickCheck >=2.7 && <2.15
51+ , QuickCheck >=2.7 && <2.14
52− , servant >=0.17 && <0.19
52+ , servant >=0.16 && <0.17
53− , servant-client >=0.17 && <0.19
53+ , servant-client >=0.16 && <0.17
54− , servant-server >=0.17 && <0.19
54+ , servant-server >=0.16 && <0.17
55 , split >=0.2 && <0.3
55 , split >=0.2 && <0.3
56 , string-conversions >=0.3 && <0.5
56 , string-conversions >=0.3 && <0.5
57 , temporary >=1.2 && <1.4
57 , temporary >=1.2 && <1.4
58 , text >=1 && <2
58 , text >=1 && <2
59− , time >=1.5 && <1.11
59+ , time >=1.5 && <1.10
60 , warp >=3.2.4 && <3.4
60 , warp >=3.2.4 && <3.4
61
61
62 if !impl(ghc >=8.0)
62 if !impl(ghc >=8.0)
src/Servant/QuickCheck/Internal/HasGenRequest.hs+6−9
@@ -63,14 +63,18 @@ instance (KnownSymbol path, HasGenRequest b) => HasGenRequest (path :> b) where
63 (oldf, old) = genRequest (Proxy :: Proxy b)
63 (oldf, old) = genRequest (Proxy :: Proxy b)
64 new = cs $ symbolVal (Proxy :: Proxy path)
64 new = cs $ symbolVal (Proxy :: Proxy path)
65
65
66+#if MIN_VERSION_servant(0,11,0)
66instance HasGenRequest EmptyAPI where
67instance HasGenRequest EmptyAPI where
67 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
68 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69+#endif
68
70
71+#if MIN_VERSION_servant(0,12,0)
69instance HasGenRequest api => HasGenRequest (Summary d :> api) where
72instance HasGenRequest api => HasGenRequest (Summary d :> api) where
70 genRequest _ = genRequest (Proxy :: Proxy api)
73 genRequest _ = genRequest (Proxy :: Proxy api)
71
74
72instance HasGenRequest api => HasGenRequest (Description d :> api) where
75instance HasGenRequest api => HasGenRequest (Description d :> api) where
73 genRequest _ = genRequest (Proxy :: Proxy api)
76 genRequest _ = genRequest (Proxy :: Proxy api)
77+#endif
74
78
75instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
79instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
76 => HasGenRequest (Capture' mods x c :> b) where
80 => HasGenRequest (Capture' mods x c :> b) where
@@ -82,6 +86,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
82 (oldf, old) = genRequest (Proxy :: Proxy b)
86 (oldf, old) = genRequest (Proxy :: Proxy b)
83 new = arbitrary :: Gen c
87 new = arbitrary :: Gen c
84
88
89+#if MIN_VERSION_servant(0,8,0)
85instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
90instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
86 => HasGenRequest (CaptureAll x c :> b) where
91 => HasGenRequest (CaptureAll x c :> b) where
87 genRequest _ = (oldf, do
92 genRequest _ = (oldf, do
@@ -92,6 +97,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
92 where
97 where
93 (oldf, old) = genRequest (Proxy :: Proxy b)
98 (oldf, old) = genRequest (Proxy :: Proxy b)
94 new = arbitrary :: Gen [c]
99 new = arbitrary :: Gen [c]
100+#endif
95
101
96instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
102instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
97 => HasGenRequest (Header' mods h c :> b) where
103 => HasGenRequest (Header' mods h c :> b) where
@@ -168,15 +174,6 @@ instance (ReflectMethod method)
168 , method = reflectMethod (Proxy :: Proxy method)
174 , method = reflectMethod (Proxy :: Proxy method)
169 })
175 })
170
176
171−instance (ReflectMethod method)
172− => HasGenRequest (NoContentVerb (method :: k)) where
173− genRequest _ = (1, return $ \burl -> defaultRequest
174− { host = cs $ baseUrlHost burl
175− , port = baseUrlPort burl
176− , secure = baseUrlScheme burl == Https
177− , method = reflectMethod (Proxy :: Proxy method)
178− })
179−
180instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
177instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
181 genRequest _ = genRequest (Proxy :: Proxy a)
178 genRequest _ = genRequest (Proxy :: Proxy a)
182
179
src/Servant/QuickCheck/Internal/QuickCheck.hs−7
@@ -11,9 +11,6 @@ import Network.Wai.Handler.Warp (withApplication)
11import Prelude.Compat
11import Prelude.Compat
12import Servant (Context (EmptyContext), HasServer,
12import Servant (Context (EmptyContext), HasServer,
13 Server, serveWithContext)
13 Server, serveWithContext)
14−#if MIN_VERSION_servant_server(0,18,0)
15−import Servant (DefaultErrorFormatters, ErrorFormatters, HasContextEntry, type (.++))
16−#endif
17import Servant.Client (BaseUrl (..), Scheme (..))
14import Servant.Client (BaseUrl (..), Scheme (..))
18import System.IO.Unsafe (unsafePerformIO)
15import System.IO.Unsafe (unsafePerformIO)
19import Test.Hspec (Expectation, expectationFailure)
16import Test.Hspec (Expectation, expectationFailure)
@@ -40,11 +37,7 @@ withServantServer api = withServantServerAndContext api EmptyContext
40-- application.
37-- application.
41--
38--
42-- /Since 0.0.0.0/
39-- /Since 0.0.0.0/
43−#if MIN_VERSION_servant_server(0,18,0)
44−withServantServerAndContext :: (HasServer a ctx, HasContextEntry (ctx .++ DefaultErrorFormatters) ErrorFormatters)
45−#else
46withServantServerAndContext :: HasServer a ctx
40withServantServerAndContext :: HasServer a ctx
47−#endif
48 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
41 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
49withServantServerAndContext api ctx server t
42withServantServerAndContext api ctx server t
50 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->
43 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->