git.iko.soy/typeable/hjsonpointer
on master help sign in
1.0.0.1: Remove HUnit dep.
commit4cf8c6f23736c7abebf7b9b81c0db6b75237577c authorIan Grant Jeffries <ian@housejeffries.com> dateFri 7 Oct 2016, 13:29 (10 years ago) parent950a712
4 files changed+19−22
MIT-LICENSE.txt+1−1 changelog.md+4 hjsonpointer.cabal+3−5 test/Unit.hs+11−16
MIT-LICENSE.txt+1−1
@@ -1,5 +1,5 @@
11The MIT License (MIT)
2−Copyright (c) 2015 Ian Grant Jeffries
2+Copyright (c) 2016 Ian Grant Jeffries
33
44Permission is hereby granted, free of charge, to any person obtaining a copy
55of this software and associated documentation files (the "Software"), to deal
changelog.md+4
@@ -1,3 +1,7 @@
1+# 1.0.0.1
2+
3++ Remove HUnit dep.
4+
15# 1.0.0.0
26
37+ Bump aeson.
hjsonpointer.cabal+3−5
@@ -1,5 +1,5 @@
11name: hjsonpointer
2−version: 1.0.0.0
2+version: 1.0.0.1
33synopsis: JSON Pointer library
44homepage: https://github.com/seagreen/hjsonpointer
55license: MIT
@@ -9,7 +9,6 @@ maintainer: ian@housejeffries.com
99category: Data
1010build-type: Simple
1111cabal-version: >=1.10
12−tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1
1312extra-source-files:
1413 changelog.md
1514 README.md
@@ -38,13 +37,13 @@ test-suite unit
3837 hs-source-dirs:
3938 test
4039 ./
40+ main-is: Unit.hs
4141 default-language: Haskell2010
42+ type: exitcode-stdio-1.0
4243 default-extensions:
4344 OverloadedStrings
4445 ghc-options:
4546 -Wall
46− type: exitcode-stdio-1.0
47− main-is: Unit.hs
4847 other-modules: Example
4948 build-depends:
5049 aeson
@@ -56,7 +55,6 @@ test-suite unit
5655 , vector
5756 , hspec >= 2.2 && < 2.3
5857 , http-types >= 0.8 && < 0.10
59− , HUnit >= 1.2 && < 1.4
6058
6159source-repository head
6260 type: git
test/Unit.hs+11−16
@@ -3,17 +3,15 @@ module Main where
33
44import Control.Arrow
55import Data.Aeson
6−import qualified Data.Aeson.Pointer as P
7−import Data.Text (Text)
8−import qualified Data.Text as T
6+import qualified Data.Aeson.Pointer as P
7+import Data.Text (Text)
8+import qualified Data.Text as T
99import Data.Text.Encoding
10−import qualified Data.Vector as V
11−import Network.HTTP.Types.URI (urlDecode)
10+import qualified Data.Vector as V
11+import Network.HTTP.Types.URI (urlDecode)
1212
1313import Test.Hspec
14−import Test.QuickCheck (property)
15−
16−import Test.HUnit hiding (Test)
14+import Test.QuickCheck (property)
1715
1816-- For GHCs before 7.10:
1917import Control.Applicative
@@ -34,7 +32,7 @@ main = hspec $ do
3432roundtrip :: P.Pointer -> Bool
3533roundtrip a = Just a == decode (encode a)
3634
37−jsonString :: Assertion
35+jsonString :: Expectation
3836jsonString = traverse_ resolvesTo
3937 [ ("" , specExample)
4038 , ("/foo" , Array $ V.fromList ["bar", "baz"])
@@ -50,7 +48,7 @@ jsonString = traverse_ resolvesTo
5048 , ("/m~0n" , Number 8)
5149 ]
5250
53−uriFragment :: Assertion
51+uriFragment :: Expectation
5452uriFragment = traverse_ resolvesTo . fmap (first decodeFragment) $
5553 [ ("#" , specExample)
5654 , ("#/foo" , Array $ V.fromList ["bar", "baz"])
@@ -69,14 +67,11 @@ uriFragment = traverse_ resolvesTo . fmap (first decodeFragment) $
6967 decodeFragment :: Text -> Text
7068 decodeFragment = T.drop 1 . decodeUtf8 . urlDecode True . encodeUtf8
7169
72−resolvesTo :: (Text, Value) -> Assertion
70+resolvesTo :: (Text, Value) -> Expectation
7371resolvesTo (t, expected) =
7472 case P.unescape t of
75− Left e -> assertFailure (show e <> " error for pointer: " <> show t)
76− Right p -> assertEqual
77− ("Resolved value for pointer: " <> show t)
78− (Right expected)
79− (P.resolve p specExample)
73+ Left e -> expectationFailure (show e <> " error for pointer: " <> show t)
74+ Right p -> P.resolve p specExample `shouldBe` Right expected
8075
8176specExample :: Value
8277specExample = object