mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
e22eb1afea
## 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
17 lines
538 B
Haskell
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
|