mirror of
https://github.com/typeable/hjsonpointer.git
synced 2024-08-17 10:30:23 +03:00
Removed dependency on QuickCheck
This commit is contained in:
parent
f9b4ecc694
commit
1d562d18c0
@ -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
|
||||
|
@ -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).
|
||||
|
11
test/Unit.hs
11
test/Unit.hs
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user