git.iko.soy/servant-quickcheck
on master help sign in
.travis.yml+110−73
since splitsnapshots
unifiedsplit
@@ -1,24 +1,30 @@
1# This Travis job script has been generated by a script via
1# This Travis job script has been generated by a script via
2#
2#
3−# haskell-ci '--branches' 'master' '-o' '.travis.yml' 'servant-quickcheck.cabal'
3+# haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
4+#
5+# To regenerate the script (for example after adjusting tested-with) run
6+#
7+# haskell-ci regenerate
4#
8#
5# For more information, see https://github.com/haskell-CI/haskell-ci
9# For more information, see https://github.com/haskell-CI/haskell-ci
6#
10#
11+# version: 0.10.1
12+#
13+version: ~> 1.0
7language: c
14language: c
15+os: linux
8dist: xenial
16dist: xenial
9−
10git:
17git:
11− submodules: false # whether to recursively clone submodules
18+ # whether to recursively clone submodules
12−
19+ submodules: false
13branches:
20branches:
14 only:
21 only:
15 - master
22 - master
16−
17cache:
23cache:
18 directories:
24 directories:
19 - $HOME/.cabal/packages
25 - $HOME/.cabal/packages
20 - $HOME/.cabal/store
26 - $HOME/.cabal/store
21−
27+ - $HOME/.hlint
22before_cache:
28before_cache:
23 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
29 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
24 # remove files that are regenerated by 'cabal update'
30 # remove files that are regenerated by 'cabal update'
@@ -27,95 +33,126 @@ before_cache:
27 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
33 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
28 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
34 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
29 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
35 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
30−
31 - rm -rfv $CABALHOME/packages/head.hackage
36 - rm -rfv $CABALHOME/packages/head.hackage
32−
37+jobs:
33−matrix:
34 include:
38 include:
35− - compiler: "ghc-8.6.3"
39+ - compiler: ghc-8.8.3
36− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
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"]}}
41+ os: linux
42+ - 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"]}}
44+ os: linux
37− - compiler: "ghc-8.4.4"
45+ - compiler: ghc-8.4.4
38− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
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"]}}
47+ os: linux
39− - compiler: "ghc-8.2.2"
48+ - compiler: ghc-8.2.2
40− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
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"]}}
50+ os: linux
41− - compiler: "ghc-8.0.2"
51+ - compiler: ghc-8.0.2
42− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
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"]}}
43− - compiler: "ghc-7.10.3"
53+ os: linux
44− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
45−
46before_install:
54before_install:
47− - HC=/opt/ghc/bin/${CC}
55+ - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
48− - HCVER=$(echo "$TRAVIS_COMPILER" | sed 's/ghc-//')
56+ - WITHCOMPILER="-w $HC"
49− - echo $HCVER
57+ - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
50− - HCPKG=${HC/ghc/ghc-pkg}
58+ - HCPKG="$HC-pkg"
51 - unset CC
59 - unset CC
52 - CABAL=/opt/ghc/bin/cabal
60 - CABAL=/opt/ghc/bin/cabal
53 - CABALHOME=$HOME/.cabal
61 - CABALHOME=$HOME/.cabal
54 - export PATH="$CABALHOME/bin:$PATH"
62 - export PATH="$CABALHOME/bin:$PATH"
55− - ROOTDIR=$(pwd)
63+ - TOP=$(pwd)
56− - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
64+ - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
57 - echo $HCNUMVER
65 - echo $HCNUMVER
58−
66+ - CABAL="$CABAL -vnormal+nowrap"
67+ - set -o pipefail
68+ - TEST=--enable-tests
69+ - BENCH=--enable-benchmarks
70+ - HEADHACKAGE=false
71+ - rm -f $CABALHOME/config
72+ - |
73+ echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
74+ echo "remote-build-reporting: anonymous" >> $CABALHOME/config
75+ echo "write-ghc-environment-files: always" >> $CABALHOME/config
76+ echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
77+ echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
78+ echo "world-file: $CABALHOME/world" >> $CABALHOME/config
79+ echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
80+ echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
81+ echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
82+ echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
83+ echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
84+ echo "install-dirs user" >> $CABALHOME/config
85+ echo " prefix: $CABALHOME" >> $CABALHOME/config
86+ echo "repository hackage.haskell.org" >> $CABALHOME/config
87+ echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
59install:
88install:
60 - ${CABAL} --version
89 - ${CABAL} --version
61 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
90 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
62− - TEST=--enable-tests
91+ - |
63− - BENCH=--enable-benchmarks
92+ echo "program-default-options" >> $CABALHOME/config
64− - GHCHEAD=${GHCHEAD-false}
93+ echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
65− - if [ "$TRAVIS_OS_NAME" = "windows" ]; then export CABALHOME=$APPDATA/cabal; else export CABALHOME=$HOME/.cabal; fi
94+ - cat $CABALHOME/config
95+ - rm -fv cabal.project cabal.project.local cabal.project.freeze
66− - travis_retry ${CABAL} update -v
96+ - travis_retry ${CABAL} v2-update -v
67− - sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
97+ # Generate cabal.project
68− - rm -fv cabal.project cabal.project.local
98+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
69− - grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
70− - rm -f cabal.project
71 - touch cabal.project
99 - touch cabal.project
72− - "printf 'packages: \".\"\\n' >> cabal.project"
100+ - |
73− - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
101+ echo "packages: ." >> cabal.project
74− - touch cabal.project.local
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+ - |
75− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-quickcheck)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
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"
76 - cat cabal.project || true
106 - cat cabal.project || true
77 - cat cabal.project.local || true
107 - cat cabal.project.local || true
78 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
108 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
79− - rm -f cabal.project.freeze
80− - ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
109+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
81− - "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
110+ - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
82− - rm "cabal.project.freeze"
111+ - rm cabal.project.freeze
83− - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
112+ - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
84− - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
113+ - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
85− - rm -rf .ghc.environment.* "."/dist
86− - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
87−
88−# Here starts the actual work to be performed for the package under test;
89−# any command which exits with a non-zero exit code causes the build to fail.
90script:
114script:
91− # test that source-distributions can be generated
115+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
116+ # Packaging...
92− - ${CABAL} new-sdist all
117+ - ${CABAL} v2-sdist all
118+ # Unpacking...
93 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
119 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
94 - cd ${DISTDIR} || false
120 - cd ${DISTDIR} || false
95− - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
121+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
96− - rm -f cabal.project
122+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
123+ - PKGDIR_servant_quickcheck="$(find . -maxdepth 1 -type d -regex '.*/servant-quickcheck-[0-9.]*')"
124+ # Generate cabal.project
125+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
97 - touch cabal.project
126 - touch cabal.project
127+ - |
128+ echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
98− - "printf 'packages: \"servant-quickcheck-*/*.cabal\"\\n' >> cabal.project"
129+ - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
99− - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
130+ - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
100− - touch cabal.project.local
131+ - |
101− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-quickcheck)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
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"
102 - cat cabal.project || true
133 - cat cabal.project || true
103 - cat cabal.project.local || true
134 - cat cabal.project.local || true
135+ # Building...
104 # this builds all libraries and executables (without tests/benchmarks)
136 # this builds all libraries and executables (without tests/benchmarks)
105− - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
137+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
106−
138+ # Building with tests and benchmarks...
107 # build & run tests, build benchmarks
139 # build & run tests, build benchmarks
108− - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
140+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
141+ # Testing...
109− - if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi
142+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
110−
111− # cabal check
143+ # cabal check...
112− - (cd servant-quickcheck-* && ${CABAL} check)
144+ - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
113−
114− # haddock
145+ # haddock...
115− - ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
146+ - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
116−
117− # Build without installed constraints for packages in global-db
147+ # Building without installed constraints for packages in global-db...
118− - rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
148+ - rm -f cabal.project.local
149+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
150+ # Constraint sets
151+ - rm -rf cabal.project.local
152+ # Constraint set base-compat-0.10
153+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all
154+ # Constraint set base-compat-0.11
155+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all
119
156
120−# REGENDATA ["--branches","master","-o",".travis.yml","servant-quickcheck.cabal"]
157+# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
121# EOF
158# EOF
CHANGELOG.yaml+15
@@ -1,4 +1,19 @@
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+
12+ - version: "0.0.8.0"
13+ changes:
14+ - description: Support for servant-0.17
15+ authors: phadej
16+ date: 2019-01-23
2
17
3 - version: "0.0.7.3"
18 - version: "0.0.7.3"
4 changes:
19 changes:
cabal.haskell-cinew file+7
@@ -0,0 +1,7 @@
1+branches: master
2+
3+constraint-set base-compat-0.10
4+ constraints: base-compat ==0.10.*
5+
6+constraint-set base-compat-0.11
7+ constraints: base-compat ==0.11.*
cabal.projectnew file+4
@@ -0,0 +1,4 @@
1+packages: .
2+tests: true
3+
4+allow-newer: servant-blaze:servant
servant-quickcheck.cabal+14−14
@@ -1,5 +1,5 @@
1name: servant-quickcheck
1name: servant-quickcheck
2−version: 0.0.7.3
2+version: 0.0.9.1
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 ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.3
16+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.3
17
17
18source-repository head
18source-repository head
19 type: git
19 type: git
@@ -35,32 +35,32 @@ library
35
35
36 build-depends:
36 build-depends:
37 aeson >=0.8 && <2
37 aeson >=0.8 && <2
38− , base >=4.8 && <4.13
38+ , base >=4.9 && <4.15
39− , base-compat-batteries >=0.10.1 && <0.11
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.8
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.7
45+ , http-client >=0.4.30 && <0.8
46− , http-media >=0.6 && <0.8
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.13
51+ , QuickCheck >=2.7 && <2.15
52− , servant >=0.13 && <0.15
52+ , servant >=0.17 && <0.19
53− , servant-client >=0.13 && <0.15
53+ , servant-client >=0.17 && <0.19
54− , servant-server >=0.13 && <0.15
54+ , servant-server >=0.17 && <0.19
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.9
59+ , time >=1.5 && <1.11
60− , warp >=3.2.4 && <3.3
60+ , warp >=3.2.4 && <3.4
61
61
62 if !impl(ghc >=8.0)
62 if !impl(ghc >=8.0)
63− build-depends: semigroups >=0.18.3 && <0.19
63+ build-depends: semigroups >=0.18.3 && <0.20
64
64
65 hs-source-dirs: src
65 hs-source-dirs: src
66 default-extensions:
66 default-extensions:
src/Servant/QuickCheck/Internal/HasGenRequest.hs+9−6
@@ -63,18 +63,14 @@ 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)
67instance HasGenRequest EmptyAPI where
66instance HasGenRequest EmptyAPI where
68 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
67 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69−#endif
70
68
71−#if MIN_VERSION_servant(0,12,0)
72instance HasGenRequest api => HasGenRequest (Summary d :> api) where
69instance HasGenRequest api => HasGenRequest (Summary d :> api) where
73 genRequest _ = genRequest (Proxy :: Proxy api)
70 genRequest _ = genRequest (Proxy :: Proxy api)
74
71
75instance HasGenRequest api => HasGenRequest (Description d :> api) where
72instance HasGenRequest api => HasGenRequest (Description d :> api) where
76 genRequest _ = genRequest (Proxy :: Proxy api)
73 genRequest _ = genRequest (Proxy :: Proxy api)
77−#endif
78
74
79instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
75instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
80 => HasGenRequest (Capture' mods x c :> b) where
76 => HasGenRequest (Capture' mods x c :> b) where
@@ -86,7 +82,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
86 (oldf, old) = genRequest (Proxy :: Proxy b)
82 (oldf, old) = genRequest (Proxy :: Proxy b)
87 new = arbitrary :: Gen c
83 new = arbitrary :: Gen c
88
84
89−#if MIN_VERSION_servant(0,8,0)
90instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
85instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
91 => HasGenRequest (CaptureAll x c :> b) where
86 => HasGenRequest (CaptureAll x c :> b) where
92 genRequest _ = (oldf, do
87 genRequest _ = (oldf, do
@@ -97,7 +92,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
97 where
92 where
98 (oldf, old) = genRequest (Proxy :: Proxy b)
93 (oldf, old) = genRequest (Proxy :: Proxy b)
99 new = arbitrary :: Gen [c]
94 new = arbitrary :: Gen [c]
100−#endif
101
95
102instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
96instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
103 => HasGenRequest (Header' mods h c :> b) where
97 => HasGenRequest (Header' mods h c :> b) where
@@ -174,6 +168,15 @@ instance (ReflectMethod method)
174 , method = reflectMethod (Proxy :: Proxy method)
168 , method = reflectMethod (Proxy :: Proxy method)
175 })
169 })
176
170
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+
177instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
180instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
178 genRequest _ = genRequest (Proxy :: Proxy a)
181 genRequest _ = genRequest (Proxy :: Proxy a)
179
182
src/Servant/QuickCheck/Internal/QuickCheck.hs+7
@@ -11,6 +11,9 @@ 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
14import Servant.Client (BaseUrl (..), Scheme (..))
17import Servant.Client (BaseUrl (..), Scheme (..))
15import System.IO.Unsafe (unsafePerformIO)
18import System.IO.Unsafe (unsafePerformIO)
16import Test.Hspec (Expectation, expectationFailure)
19import Test.Hspec (Expectation, expectationFailure)
@@ -37,7 +40,11 @@ withServantServer api = withServantServerAndContext api EmptyContext
37-- application.
40-- application.
38--
41--
39-- /Since 0.0.0.0/
42-- /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
40withServantServerAndContext :: HasServer a ctx
46withServantServerAndContext :: HasServer a ctx
47+#endif
41 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
48 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
42withServantServerAndContext api ctx server t
49withServantServerAndContext api ctx server t
43 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->
50 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->
test/Servant/QuickCheck/InternalSpec.hs+2−12
@@ -23,12 +23,7 @@ import Test.QuickCheck.Gen (generate, unGen)
23import Test.QuickCheck.Random (mkQCGen)
23import Test.QuickCheck.Random (mkQCGen)
24
24
25
25
26−#if MIN_VERSION_servant(0,8,0)
27−import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw)
26+import Servant.Test.ComprehensiveAPI (comprehensiveAPIWithoutStreamingOrRaw)
28−#else
29−import Servant.API.Internal.Test.ComprehensiveAPI (ComprehensiveAPI,
30− comprehensiveAPI)
31−#endif
32
27
33import Servant.QuickCheck
28import Servant.QuickCheck
34import Servant.QuickCheck.Internal (genRequest, runGenRequest,
29import Servant.QuickCheck.Internal (genRequest, runGenRequest,
@@ -154,7 +149,7 @@ isComprehensiveSpec :: Spec
154isComprehensiveSpec = describe "HasGenRequest" $ do
149isComprehensiveSpec = describe "HasGenRequest" $ do
155
150
156 it "has instances for all 'servant' combinators" $ do
151 it "has instances for all 'servant' combinators" $ do
157− let _g = genRequest comprehensiveAPIWithoutRaw
152+ let _g = genRequest comprehensiveAPIWithoutStreamingOrRaw
158 True `shouldBe` True -- This is a type-level check
153 True `shouldBe` True -- This is a type-level check
159
154
160deepPathSpec :: Spec
155deepPathSpec :: Spec
@@ -374,8 +369,3 @@ noOfTestCases = 20000
374#else
369#else
375noOfTestCases = 1000
370noOfTestCases = 1000
376#endif
371#endif
377−
378−#if !MIN_VERSION_servant(0,8,0)
379−comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI
380−comprehensiveAPIWithoutRaw = comprehensiveAPI
381−#endif