aeson-match-qq 1.6.0 → 1.6.1
raw patch · 4 files changed
+30/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +5/−0
- aeson-match-qq.cabal +1/−1
- src/Aeson/Match/QQ/Internal/Parse.hs +12/−2
- test/Aeson/Match/QQSpec.hs +12/−3
CHANGELOG.markdown view
@@ -1,3 +1,8 @@+1.6.1+=====++ * Fixed another parser problem (https://github.com/supki/aeson-match-qq/pull/27)+ 1.6.0 =====
aeson-match-qq.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: aeson-match-qq-version: 1.6.0+version: 1.6.1 synopsis: Declarative JSON matchers. description: See README.markdown category: Web
src/Aeson/Match/QQ/Internal/Parse.hs view
@@ -193,8 +193,18 @@ key :: Atto.Parser Text key =- Aeson.jstring <|>- fmap (Text.decodeUtf8 . ByteString.pack) (Atto.many1 (Atto.satisfy (\c -> Char.chr (fromIntegral c) `notElem` ("\\ \":;><${}[]," :: String))))+ Aeson.jstring <|> bareKey++bareKey :: Atto.Parser Text+bareKey =+ fmap+ (Text.decodeUtf8 . ByteString.pack)+ (Atto.many1+ (Atto.satisfy+ (p . Char.chr . fromIntegral)))+ where+ p c =+ not (Char.isSpace c || c `elem` ("\\\":;><${}[],#" :: String)) rest :: Atto.Parser () rest =
test/Aeson/Match/QQSpec.hs view
@@ -125,9 +125,18 @@ , given = [aesonQQ| 7 |] }) - it "named holes" $ do- match [qq| {foo: _hole} |] [aesonQQ| {foo: {bar: {baz: [1, 4]}}} |] `shouldBe`- pure (HashMap.singleton "hole" [aesonQQ| {bar: {baz: [1, 4]}} |])+ context "named holes" $ do+ it "matches" $+ match [qq| {foo: _hole} |] [aesonQQ| {foo: {bar: {baz: [1, 4]}}} |] `shouldBe`+ pure (HashMap.singleton "hole" [aesonQQ| {bar: {baz: [1, 4]}} |])++ -- https://github.com/supki/aeson-match-qq/issues/26+ it "#26" $+ match [qq|+ { foo: _hole+ }+ |] [aesonQQ| {foo: {bar: {baz: [1, 4]}}} |] `shouldBe`+ pure (HashMap.singleton "hole" [aesonQQ| {bar: {baz: [1, 4]}} |]) context "unordered array" $ it "named holes" $ do