Commit Graph

63 Commits

Author SHA1 Message Date
Maxim Koltsov
e6daf03c16
Support servant-server-0.18 2020-07-30 19:22:14 +03:00
Oleg Grenrus
13d32d6768 Support servant-0.17 2020-01-23 23:38:03 +02:00
parsonsmatt
0190e5e737 QuickCheck 2.12 Compatibility
This commit relaxes the bounds on QuickCheck, allowing it to be
compatible with 2.12. In order to be compatible with 2.12, we had to CPP
some definitions that referenced code that was deleted.
2018-10-12 13:34:13 -06:00
Alp Mestanogullari
7d6a97af5a
Merge pull request #57 from Phenitei/notAllowedBug
Fix #56: a notAllowedContainsAllowHeader bug
2018-08-29 12:01:14 +02:00
Joachim Desroches
9743ac5ec4 Fix a bug in onlyJsonObjects that made it fail if there was no
content-type.
2018-08-27 22:31:18 -06:00
Joachim Desroches
89c9170bdf
Fix #56
A bug where the request printed alongside a failure in
notAllowedContainsAllowHeader was not the request causing the failure.
2018-08-27 18:12:22 +02:00
Matt Parsons
d66c2d278a
Safer MVar usage (#49)
* Fix stack.yaml file

* Remove unfixable stack files

* Resolve ambiguous import in GHCi

* handle MVars without error

* Consistent messaging

* Add comment
2018-05-10 10:08:06 -06:00
parsonsmatt
b4a69516d2 Allow clients to pass a manager in 2018-05-09 14:30:38 -06:00
Oleg Grenrus
26523832f8 Allow base-compat-0.10 and temporary-1.3
Use base-compat-batteries
2018-04-12 09:29:23 +03:00
Oleg Grenrus
4757df4195 Support GHC-8.4.1 2018-03-23 08:13:36 +02:00
Oleg Grenrus
d46b7183ad Support for servant-0.13 2018-02-09 20:26:02 +02:00
Joachim Desroches
4f24452d03
Add forgotten predicates to export list.
The honoursAcceptHeader and getsHaveLastModifiedHeader predicates had
been omitted when writing the export list, making it necessary to import
Servant.QuickCheck.Internal.Predicates to have access to them.
2017-12-15 00:22:57 +01:00
Oleg Grenrus
3571f543fd Support for servant-0.12 2017-11-08 10:49:31 +02:00
Erik
d65abc856f [READY] Fixes #7: Add HTML missing Doctype predicate with tests (#33)
* Add HTML missing Doctype predicate with tests

* Don't use 'fail' in predicates

* Add RFC reference and description for HTML doctype

* Only take enough of respBody to compare to doctype string
2017-10-21 15:20:56 -07:00
Alfredo Di Napoli
b0febe7c58
Tentatively support Servant 0.11 2017-10-18 14:36:45 +02:00
Julian K. Arni
fa1a03257e Documenation for jsonEquality 2017-10-16 09:11:43 -07:00
Erik Aker
482656b35e Create jsonEqaulity function and add some tests for similar JSON values but slightly different whitespace, ordering 2017-10-15 20:24:21 -07:00
Erik Aker
f3b4fcf7a9 Resolve merge conflicts with unbiasedGeneration merge 2017-10-14 08:16:30 -07:00
Julian Arni
66ce50993f Unbias generation of requests. (#19)
* Unbias generation of requests:

     ...so that each endpoint is picked with the same frequency.

     Also, include a test for unbiased generation that measures mean and variance of results.
2017-10-14 07:53:04 -07:00
Erik Aker
f052dc149b Bump HSpec to 2.4.4 and make tests use safeEvaluateExample to capture failure msg 2017-07-15 15:03:06 -07:00
Nick B
d33214d376 Fix Path delimiting:
* Add test API with multiple Path elements
  * Add basic test using this API, generating an endpoint to validate that query path delimiting is happening correctly (that fails on `master`)
  * Fix (re)creation of path to prepend `/` to each new path section, but only if it's non-empty (this fixes the trailing slashes, but still allows users to use a `:> "foo/" :>...` if their API demands trailing slashes)
  * Update / fix the existing test that now fails slightly differently (i.e. the trailing slash in `failplz/` is gone)

Fixes #22.
2017-03-11 11:19:57 +00:00
Nick B
2109326ad7 QueryFlags don't use =
* Also, fix import for old `Servant` versions - _every_ version now needs `Data.Bytestring` (i.e. Servant version < 0.8, as per old lts in `stack.yaml`)
2017-03-10 08:31:56 +00:00
Nick B
77fa490b93 Fix QueryFlags too (#23)
* Same logic / testing as for `QueryParam`
 * There's probably some de-duplication that could be done here one day...
2017-03-07 22:52:38 +00:00
Nick B
6be6697165 QueryParams: fix ampersand, improve test
* Simplify test API to use `()` - no awkward values at all.
 * The test asserts on _entire_ of resulting path now...
 * ...and fix the ampersand placement, but preserving the order of params left to right. The code also reads a bit better this way...
2017-03-07 21:25:11 +00:00
Nick B
a5224276d5 Fix multiple QueryParams
* Add test API taking multiple `QueryParam`s
 * Add basic test using this API, generating an endpoint to ensure correct HTTP `one=foo&two=bar` query string generation is happening (that fails on `master`)
 * Fix (re)creation of query string to append `&` before the new parameter if there is already a built query string.

Fixes #23.
2017-03-06 13:32:55 +00:00
Julian K. Arni
b1227d3864 Make onlyJsonObjects succeed in non-JSON endpoints. 2016-10-18 14:38:44 +02:00
Julian K. Arni
4f5e6ba25a Mention that servant servers don't comply with allow header setting 2016-10-18 13:55:28 +02:00
Julian K. Arni
ae07497397 Bump version to 0.2.0.1 2016-10-05 15:36:38 +01:00
Julian K. Arni
feff40b2e4 Add notLongerThan predicate. 2016-10-05 15:29:39 +01:00
Julian K. Arni
0563caafae Newtype rather than data for predicates 2016-10-03 16:32:27 +02:00
Julian K. Arni
8eb5c334c1 Looser bounds.
Support recent versions of QuickCheck, aeson, http-client, servant,
        servant-client, and servant-server.
2016-10-03 16:30:46 +02:00
Julian K. Arni
f36f544ee6 Add predicate getsHaveLastModifiedHeader. 2016-10-03 15:39:46 +02:00
Julian K. Arni
0337996c6c Support new CaptureAll combinator. 2016-09-14 10:26:13 -03:00
Julian K. Arni
6537409968 support ghc 8 2016-09-14 09:37:14 -03:00
Julian K. Arni
343f55f61a Removing GHC 7.8 support.
It never really existed.
2016-08-28 20:50:42 -03:00
Julian K. Arni
86d99239bb Cleanup 2016-08-28 20:23:32 -03:00
Julian K. Arni
0682e353d6 Cleanup 2016-08-28 19:22:43 -03:00
Julian K. Arni
1a24673206 Valid request doc note 2016-08-28 19:15:46 -03:00
Julian K. Arni
2c1152a8c0 Much better errors 2016-08-28 19:15:26 -03:00
Julian K. Arni
b7df33fbe8 Get an error message in. 2016-08-28 13:32:48 -03:00
Julian K. Arni
70fed09866 Start implementing better error messages. 2016-08-01 11:58:10 -03:00
Julian K. Arni
26a6171265 Documentation improvements 2016-05-09 18:20:54 +02:00
Julian K. Arni
eb51069cb5 prelude-compat 2016-05-09 17:49:29 +02:00
Julian K. Arni
b48b1e8bc1 Bifunctors for GHC < 7.10.
And finish honoursAcceptHeader.
2016-05-09 17:24:04 +02:00
Julian K. Arni
530fdba5c0 More predicates, blog post 2016-05-01 14:29:47 +02:00
Julian K. Arni
64c845cb45 Slightly nicer RequestPredicate.
Which still isn't beautiful.
2016-04-30 16:25:54 +02:00
Julian K. Arni
c85d41ad79 Better failure tests 2016-04-26 14:43:02 +02:00
Julian K. Arni
9307ea2158 Add new predicates.
* notAllowedContainsAllowHeader
    * getsHaveCacheControlHeader
    * headsHaveCacheControlHeader
2016-04-25 12:32:02 +02:00
Julian K. Arni
b5ee965d1c Documentation improvements 2016-04-25 12:31:47 +02:00
Julian K. Arni
fe1d87df85 unauthorizedContainsWWWAuthenticate 2016-04-23 22:58:36 +02:00