git.iko.soy/servant-quickcheck
on 98fd048 help sign in
8 files changed+217−309
since splitsnapshots
unifiedsplit
.travis.yml+85−125 CHANGELOG.yaml−42 cabal.haskell-ci−7 cabal.project−4 servant-quickcheck.cabal+114−113 src/Servant/QuickCheck/Internal/HasGenRequest.hs+6−9 src/Servant/QuickCheck/Internal/QuickCheck.hs−7 test/Servant/QuickCheck/InternalSpec.hs+12−2
.travis.yml+85−125
@@ -1,158 +1,118 @@
11# This Travis job script has been generated by a script via
22#
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
3+# runghc make_travis_yml_2.hs '--branch' 'master' '-o' '.travis.yml' 'servant-quickcheck.cabal'
84#
95# For more information, see https://github.com/haskell-CI/haskell-ci
106#
11−# version: 0.10.1
12−#
13−version: ~> 1.0
147language: c
15−os: linux
16−dist: xenial
8+sudo: false
9+
1710git:
18− # whether to recursively clone submodules
19− submodules: false
11+ submodules: false # whether to recursively clone submodules
12+
2013branches:
2114 only:
2215 - master
16+
2317cache:
2418 directories:
2519 - $HOME/.cabal/packages
2620 - $HOME/.cabal/store
27− - $HOME/.hlint
21+
2822before_cache:
29− - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
3024 # remove files that are regenerated by 'cabal update'
31− - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
32− - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
33− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
34− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
35− - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
36− - rm -rfv $CABALHOME/packages/head.hackage
37−jobs:
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
26+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
27+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
28+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
29+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
30+
31+ - rm -rfv $HOME/.cabal/packages/head.hackage
32+
33+matrix:
3834 include:
39− - compiler: ghc-8.8.3
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
45− - 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"]}}
47− os: linux
48− - 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"]}}
50− os: linux
51− - 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"]}}
53− os: linux
35+ - compiler: "ghc-8.6.1"
36+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
37+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
38+ - compiler: "ghc-8.4.4"
39+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
40+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
41+ - compiler: "ghc-8.2.2"
42+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
43+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
44+ - compiler: "ghc-8.0.2"
45+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
46+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
47+ - compiler: "ghc-7.10.3"
48+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
49+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
50+
5451before_install:
55− - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
56− - WITHCOMPILER="-w $HC"
57− - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
58− - HCPKG="$HC-pkg"
52+ - HC=${CC}
53+ - HCPKG=${HC/ghc/ghc-pkg}
5954 - unset CC
60− - CABAL=/opt/ghc/bin/cabal
61− - CABALHOME=$HOME/.cabal
62− - export PATH="$CABALHOME/bin:$PATH"
63− - TOP=$(pwd)
64− - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
55+ - ROOTDIR=$(pwd)
56+ - mkdir -p $HOME/.local/bin
57+ - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
58+ - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
6559 - echo $HCNUMVER
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
60+
8861install:
89− - ${CABAL} --version
62+ - cabal --version
9063 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
91− - |
92− echo "program-default-options" >> $CABALHOME/config
93− echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
94− - cat $CABALHOME/config
95− - rm -fv cabal.project cabal.project.local cabal.project.freeze
96− - travis_retry ${CABAL} v2-update -v
97− # Generate cabal.project
98− - rm -rf cabal.project cabal.project.local cabal.project.freeze
99− - touch cabal.project
100− - |
101− 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− - |
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"
64+ - BENCH=${BENCH---enable-benchmarks}
65+ - TEST=${TEST---enable-tests}
66+ - HADDOCK=${HADDOCK-true}
67+ - UNCONSTRAINED=${UNCONSTRAINED-true}
68+ - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
69+ - GHCHEAD=${GHCHEAD-false}
70+ - travis_retry cabal update -v
71+ - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
72+ - rm -fv cabal.project cabal.project.local
73+ - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
74+ - "printf 'packages: \".\"\\n' > cabal.project"
75+ - touch cabal.project.local
76+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant-quickcheck | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
10677 - cat cabal.project || true
10778 - cat cabal.project.local || true
108− - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
109− - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
110− - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
111− - rm cabal.project.freeze
112− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
113− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
114−script:
79+ - if [ -f "./configure.ac" ]; then
80+ (cd "." && autoreconf -i);
81+ fi
82+ - rm -f cabal.project.freeze
83+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
84+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
85+ - rm -rf .ghc.environment.* "."/dist
11586 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
116− # Packaging...
117− - ${CABAL} v2-sdist all
118− # Unpacking...
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.
90+script:
91+ # test that source-distributions can be generated
92+ - cabal new-sdist all
11993 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
12094 - cd ${DISTDIR} || false
121− - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
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
126− - touch cabal.project
127− - |
128− 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− - |
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"
95+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
96+ - "printf 'packages: servant-quickcheck-*/*.cabal\\n' > cabal.project"
97+ - touch cabal.project.local
98+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant-quickcheck | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
13399 - cat cabal.project || true
134100 - cat cabal.project.local || true
135− # Building...
136101 # this builds all libraries and executables (without tests/benchmarks)
137− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
138− # Building with tests and benchmarks...
102+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
103+
139104 # build & run tests, build benchmarks
140− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
141− # Testing...
142− - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
143− # cabal check...
144− - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
145− # haddock...
146− - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
147− # Building without installed constraints for packages in global-db...
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
105+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
106+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
107+
108+ # cabal check
109+ - (cd servant-quickcheck-* && cabal check)
110+
111+ # haddock
112+ - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
113+
114+ # Build without installed constraints for packages in global-db
115+ - if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
156116
157−# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
117+# REGENDATA ["--branch","master","-o",".travis.yml","servant-quickcheck.cabal"]
158118# EOF
CHANGELOG.yaml−42
@@ -1,46 +1,4 @@
11releases:
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
17−
18− - version: "0.0.7.3"
19− changes:
20− - description: Support for servant-0.14
21− issue: 53
22− authors: phadej
23− date: 2018-06-12
24−
25− - description: Fix a failure from OnlyJsonObjects when there is no content-type.
26− issue: 55
27− authors: Phenitei
28− date: 2018-08-27
29−
30− - description: A bug fix where notAllowedContainsAllowHeader would print the initial request alongside the failure instead of the request causing the failure when it failed.
31− issue: 57
32− authors: Phenitei
33− date: 2018-08-29
34−
35− - description: QuickCheck 2.12 compatibility
36− issue: 58
37− authors: parsonsmatt
38− date: 2018-10-12
39−
40− - description: GHC 8.6 compatibility
41− issue: 59
42− authors: phadej
43− date: 2018-10-15
442
453 - version: "0.0.7.2"
464 changes:
cabal.haskell-cideleted−7
@@ -1,7 +0,0 @@
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.projectdeleted−4
@@ -1,4 +0,0 @@
1−packages: .
2−tests: true
3−
4−allow-newer: servant-blaze:servant
servant-quickcheck.cabal+114−113
@@ -1,22 +1,30 @@
1−name: servant-quickcheck
2−version: 0.0.9.1
3−synopsis: QuickCheck entire APIs
1+name: servant-quickcheck
2+version: 0.0.7.2
3+x-revision: 1
4+synopsis: QuickCheck entire APIs
45description:
5− This packages provides QuickCheck properties that are tested across an entire
6− API.
6+ This packages provides QuickCheck properties that are tested across an entire
7+ API.
8+
9+license: BSD3
10+license-file: LICENSE
11+author: Julian K. Arni
12+maintainer: jkarni@gmail.com
13+category: Web
14+build-type: Simple
15+cabal-version: >=1.10
16+extra-source-files:
17+ CHANGELOG.yaml
18+tested-with:
19+ GHC ==7.10.3
20+ || ==8.0.2
21+ || ==8.2.2
22+ || ==8.4.4
23+ || ==8.6.1
724
8−license: BSD3
9−license-file: LICENSE
10−author: Julian K. Arni
11−maintainer: jkarni@gmail.com
12−category: Web
13−build-type: Simple
14−cabal-version: >=1.10
15−extra-source-files: CHANGELOG.yaml
16−tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.3
1725
1826source-repository head
19− type: git
27+ type: git
2028 location: https://github.com/haskell-servant/servant-quickcheck
2129
2230flag long-tests
@@ -24,115 +32,108 @@ flag long-tests
2432 default: False
2533
2634library
27− exposed-modules:
28− Servant.QuickCheck
29− Servant.QuickCheck.Internal
30− Servant.QuickCheck.Internal.Equality
31− Servant.QuickCheck.Internal.ErrorTypes
32− Servant.QuickCheck.Internal.HasGenRequest
33− Servant.QuickCheck.Internal.Predicates
34− Servant.QuickCheck.Internal.QuickCheck
35−
36− build-depends:
37− aeson >=0.8 && <2
38− , base >=4.9 && <4.15
39− , base-compat-batteries >=0.10.1 && <0.12
40− , bytestring >=0.10 && <0.11
41− , case-insensitive >=1.2 && <1.3
42− , clock >=0.7 && <0.9
43− , data-default-class >=0.0 && <0.2
44− , hspec >=2.5.6 && <2.8
45− , http-client >=0.4.30 && <0.8
46− , http-media >=0.6 && <0.9
47− , http-types >=0.8 && <0.13
48− , mtl >=2.1 && <2.3
49− , pretty >=1.1 && <1.2
50− , process >=1.2 && <1.7
51− , QuickCheck >=2.7 && <2.15
52− , servant >=0.17 && <0.19
53− , servant-client >=0.17 && <0.19
54− , servant-server >=0.17 && <0.19
55− , split >=0.2 && <0.3
56− , string-conversions >=0.3 && <0.5
57− , temporary >=1.2 && <1.4
58− , text >=1 && <2
59− , time >=1.5 && <1.11
60− , warp >=3.2.4 && <3.4
35+ exposed-modules: Servant.QuickCheck
36+ , Servant.QuickCheck.Internal
37+ , Servant.QuickCheck.Internal.Predicates
38+ , Servant.QuickCheck.Internal.HasGenRequest
39+ , Servant.QuickCheck.Internal.QuickCheck
40+ , Servant.QuickCheck.Internal.Equality
41+ , Servant.QuickCheck.Internal.ErrorTypes
42+ build-depends: base >=4.8 && <4.13
43+ , base-compat-batteries >= 0.10.1 && <0.11
44+ , aeson > 0.8 && < 2
45+ , bytestring == 0.10.*
46+ , case-insensitive == 1.2.*
47+ , clock >= 0.7 && < 0.8
48+ , data-default-class >= 0.0 && < 0.2
49+ , hspec >= 2.5.6 && < 2.6
6150
62− if !impl(ghc >=8.0)
63− build-depends: semigroups >=0.18.3 && <0.20
51+ , http-client >= 0.4.30 && < 0.6
52+ , http-media >= 0.6 && <0.8
53+ , http-types > 0.8 && < 0.13
54+ , mtl > 2.1 && < 2.3
55+ , pretty == 1.1.*
56+ , process >= 1.2 && < 1.7
57+ , QuickCheck > 2.7 && < 2.13
58+ , servant >= 0.13 && < 0.15
59+ , servant-client >= 0.13 && < 0.15
60+ , servant-server >= 0.13 && < 0.15
61+ , split == 0.2.*
62+ , string-conversions > 0.3 && < 0.5
63+ , temporary >= 1.2 && <1.4
64+ , text == 1.*
65+ , time >= 1.5 && < 1.9
66+ , warp >= 3.2.4 && < 3.3
6467
65− hs-source-dirs: src
66− default-extensions:
67− NoImplicitPrelude
68− ConstraintKinds
69− DataKinds
70− DeriveDataTypeable
71− DeriveFunctor
72− DeriveGeneric
73− FlexibleContexts
74− FlexibleInstances
75− FunctionalDependencies
76− GADTs
77− KindSignatures
78− MultiParamTypeClasses
79− OverloadedStrings
80− RankNTypes
81− ScopedTypeVariables
82− TypeOperators
68+ if !impl(ghc >= 8.0)
69+ build-depends:
70+ semigroups >= 0.18.3 && <0.19
8371
84− default-language: Haskell2010
72+ hs-source-dirs: src
73+ default-extensions: TypeOperators
74+ , FlexibleInstances
75+ , FlexibleContexts
76+ , DataKinds
77+ , GADTs
78+ , MultiParamTypeClasses
79+ , DeriveFunctor
80+ , KindSignatures
81+ , RankNTypes
82+ , ConstraintKinds
83+ , DeriveGeneric
84+ , ScopedTypeVariables
85+ , OverloadedStrings
86+ , FunctionalDependencies
87+ , NoImplicitPrelude
88+ , DeriveDataTypeable
89+ default-language: Haskell2010
8590
8691test-suite spec
87− type: exitcode-stdio-1.0
88− ghc-options: -Wall -threaded
89− default-language: Haskell2010
90− hs-source-dirs: test
91− main-is: Spec.hs
92− other-modules: Servant.QuickCheck.InternalSpec
93− build-tool-depends: hspec-discover:hspec-discover -any
94− build-depends:
95− aeson
96− , base
97− , base-compat-batteries
98− , blaze-html
99− , bytestring
100− , hspec
101− , hspec-core >=2.5.5 && <2.8
102− , http-client
103− , QuickCheck
104− , quickcheck-io
105− , servant
106− , servant-blaze
107− , servant-client
108− , servant-quickcheck
109− , servant-server
110− , transformers
111− , warp
112−
113− default-extensions:
114− NoImplicitPrelude
115− DataKinds
116− FlexibleContexts
117− FlexibleInstances
118− GADTs
119− OverloadedStrings
120− ScopedTypeVariables
121− TypeOperators
122−
92+ type: exitcode-stdio-1.0
93+ ghc-options: -Wall -threaded
94+ default-language: Haskell2010
95+ hs-source-dirs: test
96+ main-is: Spec.hs
97+ other-modules: Servant.QuickCheck.InternalSpec
98+ build-tool-depends: hspec-discover:hspec-discover
99+ build-depends: base
100+ , base-compat-batteries
101+ , aeson
102+ , servant-quickcheck
103+ , bytestring
104+ , hspec
105+ , hspec-core >= 2.5.5 && < 2.6
106+ , http-client
107+ , blaze-html
108+ , warp
109+ , servant-server
110+ , servant-client
111+ , servant
112+ , servant-blaze
113+ , transformers
114+ , QuickCheck
115+ , quickcheck-io
116+ default-extensions: TypeOperators
117+ , FlexibleInstances
118+ , FlexibleContexts
119+ , GADTs
120+ , DataKinds
121+ , NoImplicitPrelude
122+ , OverloadedStrings
123+ , ScopedTypeVariables
123124 if flag(long-tests)
124− cpp-options: -DLONG_TESTS
125+ cpp-options: -DLONG_TESTS
125126
126127test-suite example
127− type: exitcode-stdio-1.0
128− main-is: Main.hs
129− hs-source-dirs: example
130− ghc-options: -Wall
128+ type: exitcode-stdio-1.0
129+ main-is: Main.hs
130+ hs-source-dirs:
131+ example
132+ ghc-options: -Wall
131133 build-depends:
132134 base
133135 , hspec
134− , servant-quickcheck
135136 , servant-server
137+ , servant-quickcheck
136138 , text
137−
138139 default-language: Haskell2010
src/Servant/QuickCheck/Internal/HasGenRequest.hs+6−9
@@ -63,14 +63,18 @@ instance (KnownSymbol path, HasGenRequest b) => HasGenRequest (path :> b) where
6363 (oldf, old) = genRequest (Proxy :: Proxy b)
6464 new = cs $ symbolVal (Proxy :: Proxy path)
6565
66+#if MIN_VERSION_servant(0,11,0)
6667instance HasGenRequest EmptyAPI where
6768 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69+#endif
6870
71+#if MIN_VERSION_servant(0,12,0)
6972instance HasGenRequest api => HasGenRequest (Summary d :> api) where
7073 genRequest _ = genRequest (Proxy :: Proxy api)
7174
7275instance HasGenRequest api => HasGenRequest (Description d :> api) where
7376 genRequest _ = genRequest (Proxy :: Proxy api)
77+#endif
7478
7579instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
7680 => HasGenRequest (Capture' mods x c :> b) where
@@ -82,6 +86,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8286 (oldf, old) = genRequest (Proxy :: Proxy b)
8387 new = arbitrary :: Gen c
8488
89+#if MIN_VERSION_servant(0,8,0)
8590instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8691 => HasGenRequest (CaptureAll x c :> b) where
8792 genRequest _ = (oldf, do
@@ -92,6 +97,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
9297 where
9398 (oldf, old) = genRequest (Proxy :: Proxy b)
9499 new = arbitrary :: Gen [c]
100+#endif
95101
96102instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
97103 => HasGenRequest (Header' mods h c :> b) where
@@ -168,15 +174,6 @@ instance (ReflectMethod method)
168174 , method = reflectMethod (Proxy :: Proxy method)
169175 })
170176
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−
180177instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
181178 genRequest _ = genRequest (Proxy :: Proxy a)
182179
src/Servant/QuickCheck/Internal/QuickCheck.hs−7
@@ -11,9 +11,6 @@ import Network.Wai.Handler.Warp (withApplication)
1111import Prelude.Compat
1212import Servant (Context (EmptyContext), HasServer,
1313 Server, serveWithContext)
14−#if MIN_VERSION_servant_server(0,18,0)
15−import Servant (DefaultErrorFormatters, ErrorFormatters, HasContextEntry, type (.++))
16−#endif
1714import Servant.Client (BaseUrl (..), Scheme (..))
1815import System.IO.Unsafe (unsafePerformIO)
1916import Test.Hspec (Expectation, expectationFailure)
@@ -40,11 +37,7 @@ withServantServer api = withServantServerAndContext api EmptyContext
4037-- application.
4138--
4239-- /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
4640withServantServerAndContext :: HasServer a ctx
47−#endif
4841 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
4942withServantServerAndContext api ctx server t
5043 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->
test/Servant/QuickCheck/InternalSpec.hs+12−2
@@ -23,7 +23,12 @@ import Test.QuickCheck.Gen (generate, unGen)
2323import Test.QuickCheck.Random (mkQCGen)
2424
2525
26−import Servant.Test.ComprehensiveAPI (comprehensiveAPIWithoutStreamingOrRaw)
26+#if MIN_VERSION_servant(0,8,0)
27+import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw)
28+#else
29+import Servant.API.Internal.Test.ComprehensiveAPI (ComprehensiveAPI,
30+ comprehensiveAPI)
31+#endif
2732
2833import Servant.QuickCheck
2934import Servant.QuickCheck.Internal (genRequest, runGenRequest,
@@ -149,7 +154,7 @@ isComprehensiveSpec :: Spec
149154isComprehensiveSpec = describe "HasGenRequest" $ do
150155
151156 it "has instances for all 'servant' combinators" $ do
152− let _g = genRequest comprehensiveAPIWithoutStreamingOrRaw
157+ let _g = genRequest comprehensiveAPIWithoutRaw
153158 True `shouldBe` True -- This is a type-level check
154159
155160deepPathSpec :: Spec
@@ -369,3 +374,8 @@ noOfTestCases = 20000
369374#else
370375noOfTestCases = 1000
371376#endif
377+
378+#if !MIN_VERSION_servant(0,8,0)
379+comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI
380+comprehensiveAPIWithoutRaw = comprehensiveAPI
381+#endif