From 4cf8c6f23736c7abebf7b9b81c0db6b75237577c Mon Sep 17 00:00:00 2001 From: Ian Grant Jeffries Date: Fri, 7 Oct 2016 13:29:50 -0400 Subject: [PATCH] 1.0.0.1: Remove HUnit dep. --- MIT-LICENSE.txt | 2 +- changelog.md | 4 ++++ hjsonpointer.cabal | 8 +++----- test/Unit.hs | 27 +++++++++++---------------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index 2dae2b2..992f4e4 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -1,5 +1,5 @@ The MIT License (MIT) -Copyright (c) 2015 Ian Grant Jeffries +Copyright (c) 2016 Ian Grant Jeffries Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/changelog.md b/changelog.md index 2bce53d..f97b5eb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# 1.0.0.1 + ++ Remove HUnit dep. + # 1.0.0.0 + Bump aeson. diff --git a/hjsonpointer.cabal b/hjsonpointer.cabal index f391a7f..01a6f7f 100644 --- a/hjsonpointer.cabal +++ b/hjsonpointer.cabal @@ -1,5 +1,5 @@ name: hjsonpointer -version: 1.0.0.0 +version: 1.0.0.1 synopsis: JSON Pointer library homepage: https://github.com/seagreen/hjsonpointer license: MIT @@ -9,7 +9,6 @@ maintainer: ian@housejeffries.com category: Data build-type: Simple cabal-version: >=1.10 -tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 extra-source-files: changelog.md README.md @@ -38,13 +37,13 @@ test-suite unit hs-source-dirs: test ./ + main-is: Unit.hs default-language: Haskell2010 + type: exitcode-stdio-1.0 default-extensions: OverloadedStrings ghc-options: -Wall - type: exitcode-stdio-1.0 - main-is: Unit.hs other-modules: Example build-depends: aeson @@ -56,7 +55,6 @@ test-suite unit , vector , hspec >= 2.2 && < 2.3 , http-types >= 0.8 && < 0.10 - , HUnit >= 1.2 && < 1.4 source-repository head type: git diff --git a/test/Unit.hs b/test/Unit.hs index 45fb607..4f1b054 100644 --- a/test/Unit.hs +++ b/test/Unit.hs @@ -3,17 +3,15 @@ module Main where import Control.Arrow import Data.Aeson -import qualified Data.Aeson.Pointer as P -import Data.Text (Text) -import qualified Data.Text as T +import qualified Data.Aeson.Pointer as P +import Data.Text (Text) +import qualified Data.Text as T import Data.Text.Encoding -import qualified Data.Vector as V -import Network.HTTP.Types.URI (urlDecode) +import qualified Data.Vector as V +import Network.HTTP.Types.URI (urlDecode) import Test.Hspec -import Test.QuickCheck (property) - -import Test.HUnit hiding (Test) +import Test.QuickCheck (property) -- For GHCs before 7.10: import Control.Applicative @@ -34,7 +32,7 @@ main = hspec $ do roundtrip :: P.Pointer -> Bool roundtrip a = Just a == decode (encode a) -jsonString :: Assertion +jsonString :: Expectation jsonString = traverse_ resolvesTo [ ("" , specExample) , ("/foo" , Array $ V.fromList ["bar", "baz"]) @@ -50,7 +48,7 @@ jsonString = traverse_ resolvesTo , ("/m~0n" , Number 8) ] -uriFragment :: Assertion +uriFragment :: Expectation uriFragment = traverse_ resolvesTo . fmap (first decodeFragment) $ [ ("#" , specExample) , ("#/foo" , Array $ V.fromList ["bar", "baz"]) @@ -69,14 +67,11 @@ uriFragment = traverse_ resolvesTo . fmap (first decodeFragment) $ decodeFragment :: Text -> Text decodeFragment = T.drop 1 . decodeUtf8 . urlDecode True . encodeUtf8 -resolvesTo :: (Text, Value) -> Assertion +resolvesTo :: (Text, Value) -> Expectation resolvesTo (t, expected) = case P.unescape t of - Left e -> assertFailure (show e <> " error for pointer: " <> show t) - Right p -> assertEqual - ("Resolved value for pointer: " <> show t) - (Right expected) - (P.resolve p specExample) + Left e -> expectationFailure (show e <> " error for pointer: " <> show t) + Right p -> P.resolve p specExample `shouldBe` Right expected specExample :: Value specExample = object