git.iko.soy/typeable/hjsonpointer
on master help sign in
Merge pull request #5 from mmhat/no-quickcheck

Removed dependency on QuickCheck

commit84f02e6eb2b9160539fff7c581cf24a7a5e983a0 authorIan Jeffries <ianspiral@gmail.com> dateSat 29 Sep 2018, 23:52 (8 years ago) parentf9b4ecc1d562d1
3 files changed+11−7
hjsonpointer.cabal−1 src/JSONPointer.hs+1−5 test/Unit.hs+10−1
hjsonpointer.cabal−1
@@ -27,7 +27,6 @@ library
2727 base >= 4.6 && < 5
2828 , aeson >= 0.7
2929 , hashable >= 1.2
30− , QuickCheck >= 2.8
3130 , unordered-containers >= 0.2
3231 , text >= 1.2
3332 , vector >= 0.10
src/JSONPointer.hs+1−5
@@ -13,7 +13,6 @@ import Data.Text (Text)
1313import qualified Data.Text as T
1414import qualified Data.Vector as V
1515import GHC.Generics (Generic)
16−import Test.QuickCheck
1716import Text.Read (readMaybe)
1817
1918--------------------------------------------------
@@ -37,7 +36,7 @@ resolve (Pointer (t:ts)) v = resolveToken t v >>= resolve (Pointer ts)
3736
3837newtype Pointer
3938 = Pointer { _unPointer :: [Token] }
40− deriving (Eq, Show, Semigroup, Monoid, Generic, Arbitrary)
39+ deriving (Eq, Show, Semigroup, Monoid, Generic)
4140
4241instance HA.Hashable Pointer
4342
@@ -63,9 +62,6 @@ newtype Token
6362
6463instance HA.Hashable Token
6564
66−instance Arbitrary Token where
67− arbitrary = Token . T.pack <$> arbitrary
68−
6965-- | This escapes @"/"@ (because it's the token separator character).
7066--
7167-- It also escapes @"~"@ (because it's the escape character).
test/Unit.hs+10−1
@@ -1,3 +1,7 @@
1+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2+{-# LANGUAGE StandaloneDeriving #-}
3+
4+{-# OPTIONS_GHC -fno-warn-orphans #-}
15
26module Main where
37
@@ -13,10 +17,15 @@ import qualified JSONPointer as JP
1317import Network.HTTP.Types.URI (urlDecode)
1418
1519import Test.Hspec
16−import Test.QuickCheck (property)
20+import Test.QuickCheck (Arbitrary(..), property)
1721
1822import qualified Example
1923
24+deriving instance Arbitrary JP.Pointer
25+
26+instance Arbitrary JP.Token where
27+ arbitrary = JP.Token . T.pack <$> arbitrary
28+
2029main :: IO ()
2130main = hspec $ do
2231 describe "example" $ do