graphql-engine/server/src-test/Data/Parser/URLTemplateSpec.hs
Tom Harding e22eb1afea Weeding (2/?)
## Description

Following on from #4572, this removes more dead code as identified by Weeder. Comments and thoughts similarly welcome!

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4587
GitOrigin-RevId: 73aa6a5a2833ee41d29b71fcd0a72ed19822ca73
2022-06-09 16:40:49 +00:00

17 lines
538 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