mirror of
https://github.com/ilyakooo0/servant-quickcheck.git
synced 2024-08-17 06:10:27 +03:00
Add sanity check test in there to prove jsonEquality really is doing something different
This commit is contained in:
parent
482656b35e
commit
3f6856103a
@ -71,12 +71,18 @@ serversEqualSpec = describe "serversEqual" $ do
|
||||
|
||||
context "when JSON is equal but looks a bit different as a ByteString" $ do
|
||||
|
||||
it "considers equal JSON apis equal regardless of ordering or whitespace" $ do
|
||||
it "sanity check: different whitespace same JSON objects bodyEquality fails" $ do
|
||||
Right (Failure _ err) <- withServantServer jsonApi jsonServer1 $ \burl1 ->
|
||||
withServantServer jsonApi jsonServer2 $ \burl2 -> do
|
||||
safeEvalExample $ serversEqual jsonApi burl1 burl2 args bodyEquality
|
||||
show err `shouldContain` "Server equality failed"
|
||||
|
||||
it "jsonEquality considers equal JSON apis equal regardless of key ordering or whitespace" $ do
|
||||
withServantServerAndContext jsonApi ctx jsonServer1 $ \burl1 ->
|
||||
withServantServerAndContext jsonApi ctx jsonServer2 $ \burl2 ->
|
||||
serversEqual jsonApi burl1 burl2 args jsonEquality
|
||||
|
||||
it "sees when JSON apis are not equal regardless of ordering or whitespace" $ do
|
||||
it "sees when JSON apis are not equal because any value is different" $ do
|
||||
Right (Failure _ err) <- withServantServer jsonApi jsonServer2 $ \burl1 ->
|
||||
withServantServer jsonApi jsonServer3 $ \burl2 -> do
|
||||
safeEvalExample $ serversEqual jsonApi burl1 burl2 args jsonEquality
|
||||
|
Loading…
Reference in New Issue
Block a user