on master help sign in
OK, really drop aeson-qq
commit7c1955092c682b900e1ac85f5abb0581e1b198fa authorMichael Snoyman <michael@snoyman.com> dateFri 29 Dec 2017, 08:47 (9 years ago) parent9434ed2
2 files changed+23−19
ChangeLog.md+1−1 test/Data/Yaml/IncludeSpec.hs+22−18
ChangeLog.md+1−1
@@ -1,6 +1,6 @@
11## 0.8.25.1
22
3−* Drop unused aeson-qq dep
3+* Drop aeson-qq dep (incompatible with Stackage Nightly)
44
55## 0.8.25
66
test/Data/Yaml/IncludeSpec.hs+22−18
@@ -1,10 +1,9 @@
1−{-# LANGUAGE QuasiQuotes #-}
1+{-# LANGUAGE OverloadedStrings #-}
22module Data.Yaml.IncludeSpec (main, spec) where
33
44import Test.Hspec
55import Data.List (isPrefixOf)
66import Data.Aeson
7−import Data.Aeson.QQ
87import Data.Yaml (ParseException(InvalidYaml))
98import Data.Yaml.Include
109import Text.Libyaml (YamlException(YamlException))
@@ -12,28 +11,33 @@ import Text.Libyaml (YamlException(YamlException))
1211main :: IO ()
1312main = hspec spec
1413
14+asInt :: Int -> Int
15+asInt = id
16+
1517spec :: Spec
1618spec = do
1719 describe "decodeFile" $ do
1820 it "supports includes" $ do
19− decodeFile "test/resources/foo.yaml" `shouldReturn` Just [aesonQQ|
20− {
21− foo: 23,
22− bar: {one: 1, two: 2},
23− baz: 42
24− }
25− |]
21+ decodeFile "test/resources/foo.yaml" `shouldReturn` Just (object
22+ [ "foo" .= asInt 23
23+ , "bar" .= object
24+ [ "one" .= asInt 1
25+ , "two" .= asInt 2
26+ ]
27+ , "baz" .= asInt 42
28+ ])
2629
2730 it "supports recursive includes" $ do
28− decodeFile "test/resources/baz.yaml" `shouldReturn` Just [aesonQQ|
29− {
30− foo: {
31− foo: 23,
32− bar: {one: 1, two: 2},
33− baz: 42
34− }
35− }
36− |]
31+ decodeFile "test/resources/baz.yaml" `shouldReturn` Just (object
32+ [ "foo" .= object
33+ [ "foo" .= asInt 23
34+ , "bar" .= object
35+ [ "one" .= asInt 1
36+ , "two" .= asInt 2
37+ ]
38+ , "baz" .= asInt 42
39+ ]
40+ ])
3741
3842 it "aborts on cyclic includes" $ do
3943 (decodeFile "test/resources/loop/foo.yaml" :: IO (Maybe Value)) `shouldThrow` anyException