graphql-engine/server/src-test/Data/Parser/URLTemplateSpec.hs
Tom Harding e0c0043e76 Upgrade Ormolu to 0.7.0.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9284
GitOrigin-RevId: 2f2cf2ad01900a54e4bdb970205ac0ef313c7e00
2023-05-24 13:53:53 +00:00

18 lines
518 B
Haskell

module Data.Parser.URLTemplateSpec (spec) where
import Data.URL.Template
import Hasura.Prelude
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = describe "parseURLTemplate"
$ it "URL template parser and printer"
$ withMaxSuccess 1000
$ forAll (arbitrary :: Gen URLTemplate)
$ \urlTemplate -> do
let templateString = printURLTemplate urlTemplate
case parseURLTemplate templateString of
Left e -> counterexample e False
Right r -> property $ printURLTemplate r == templateString