mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
e0c0043e76
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9284 GitOrigin-RevId: 2f2cf2ad01900a54e4bdb970205ac0ef313c7e00
18 lines
518 B
Haskell
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
|