Removed dependency on QuickCheck

This commit is contained in:
Mann mit Hut 2018-08-24 15:29:51 +02:00
parent f9b4ecc694
commit 1d562d18c0
No known key found for this signature in database
GPG Key ID: 370CD5C109468E78
3 changed files with 11 additions and 7 deletions

View File

@ -27,7 +27,6 @@ library
base >= 4.6 && < 5
, aeson >= 0.7
, hashable >= 1.2
, QuickCheck >= 2.8
, unordered-containers >= 0.2
, text >= 1.2
, vector >= 0.10

View File

@ -13,7 +13,6 @@ import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Vector as V
import GHC.Generics (Generic)
import Test.QuickCheck
import Text.Read (readMaybe)
--------------------------------------------------
@ -37,7 +36,7 @@ resolve (Pointer (t:ts)) v = resolveToken t v >>= resolve (Pointer ts)
newtype Pointer
= Pointer { _unPointer :: [Token] }
deriving (Eq, Show, Semigroup, Monoid, Generic, Arbitrary)
deriving (Eq, Show, Semigroup, Monoid, Generic)
instance HA.Hashable Pointer
@ -63,9 +62,6 @@ newtype Token
instance HA.Hashable Token
instance Arbitrary Token where
arbitrary = Token . T.pack <$> arbitrary
-- | This escapes @"/"@ (because it's the token separator character).
--
-- It also escapes @"~"@ (because it's the escape character).

View File

@ -1,3 +1,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main where
@ -13,10 +17,15 @@ import qualified JSONPointer as JP
import Network.HTTP.Types.URI (urlDecode)
import Test.Hspec
import Test.QuickCheck (property)
import Test.QuickCheck (Arbitrary(..), property)
import qualified Example
deriving instance Arbitrary JP.Pointer
instance Arbitrary JP.Token where
arbitrary = JP.Token . T.pack <$> arbitrary
main :: IO ()
main = hspec $ do
describe "example" $ do