hspec-expectations-json 1.0.0.4 → 1.0.0.5
raw patch · 3 files changed
+17/−14 lines, 3 filesdep −unordered-containersdep ~HUnitdep ~aesondep ~aeson-prettyPVP ok
version bump matches the API change (PVP)
Dependencies removed: unordered-containers
Dependency ranges changed: HUnit, aeson, aeson-pretty, aeson-qq, hspec, scientific, vector
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- hspec-expectations-json.cabal +8/−9
- library/Test/Hspec/Expectations/Json/Internal.hs +5/−5
CHANGELOG.md view
@@ -2,6 +2,10 @@ None +## [v1.0.0.5](https://github.com/freckle/hspec-expectations-json/compare/v1.0.0.4...v1.0.0.5)++- Add lower bound for `aeson` 2.x+ ## [v1.0.0.4](https://github.com/freckle/hspec-expectations-json/compare/v1.0.0.3...v1.0.0.4) - Remove dependencies upper bounds
hspec-expectations-json.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: hspec-expectations-json-version: 1.0.0.4+version: 1.0.0.5 license: MIT license-file: LICENSE copyright: 2020 Freckle Education@@ -58,14 +58,13 @@ build-depends: Diff >=0.4.0,- HUnit >=1.6.1.0,- aeson >=1.4.7.1,- aeson-pretty >=0.8.8,+ HUnit >=1.6.2.0,+ aeson >=2.0.0.0,+ aeson-pretty >=0.8.9, base >=4.11 && <5,- scientific >=0.3.6.2,+ scientific >=0.3.7.0, text >1.2,- unordered-containers >=0.2.10.0,- vector >=0.12.1.2+ vector >=0.12.3.1 test-suite spec type: exitcode-stdio-1.0@@ -87,7 +86,7 @@ TypeApplications TypeFamilies build-depends:- aeson-qq >=0.8.3,+ aeson-qq >=0.8.4, base >=4.11 && <5,- hspec >=2.7.4,+ hspec >=2.8.5, hspec-expectations-json -any
library/Test/Hspec/Expectations/Json/Internal.hs view
@@ -23,7 +23,7 @@ import Data.Aeson import Data.Algorithm.Diff (PolyDiff(..), getDiff)-import qualified Data.HashMap.Strict as HashMap+import qualified Data.Aeson.KeyMap as KeyMap import Data.List (sortOn) import qualified Data.Scientific as Scientific import Data.Text (Text)@@ -52,7 +52,7 @@ pruneJson :: Superset -> Subset -> Value pruneJson (Superset sup) (Subset sub) = case (sup, sub) of (Object a, Object b) -> Object- $ HashMap.intersectionWith (\x y -> pruneJson (Superset x) (Subset y)) a b+ $ KeyMap.intersectionWith (\x y -> pruneJson (Superset x) (Subset y)) a b -- Pruning elements in Arrays is *extremely* tricky in that it interacts with -- both sorting and matching in what should be a function independent of those@@ -93,7 +93,7 @@ (Null, Null) -> EQ -- forgive me (Array x, Array y) -> V.map Sortable x `compare` V.map Sortable y (Object x, Object y) ->- HashMap.map Sortable x `compare` HashMap.map Sortable y+ (Sortable <$> x) `compare` (Sortable <$> y) (x, y) -> arbitraryRank x `compare` arbitraryRank y where arbitraryRank :: Value -> Int@@ -108,7 +108,7 @@ sortJsonArrays :: Value -> Value sortJsonArrays = \case Array v -> Array $ vectorSortOn Sortable $ sortJsonArrays <$> v- Object hm -> Object $ HashMap.map sortJsonArrays hm+ Object hm -> Object $ sortJsonArrays <$> hm x@String{} -> x x@Number{} -> x x@Bool{} -> x@@ -130,7 +130,7 @@ -- normalizeScientific :: Value -> Value normalizeScientific = \case- Object hm -> Object $ HashMap.map normalizeScientific hm+ Object hm -> Object $ normalizeScientific <$> hm Array vs -> Array $ normalizeScientific <$> vs x@String{} -> x Number sci ->