@@ -4,6 +4,7 @@ module Data.Yaml.IncludeSpec (main, spec) where
44
55import Test.Hspec
66import Data.List (isPrefixOf)
7+import qualified Data.ByteString.Lazy as LB
78import Data.Aeson
89import Data.Aeson.Internal (JSONPathElement(..))
910import Data.Yaml (ParseException(InvalidYaml))
@@ -52,6 +53,15 @@ spec = do
5253 it "throws Left (InvalidYaml (Just (YamlException \"Yaml file not found: ...\")))" $ do
5354 (decodeFile "./does_not_exist.yaml" :: IO (Maybe Value)) `shouldThrow` isYamlFileNotFoundException
5455
56+ context "with a 1K stack size limit" $ around_ inTempDirectory $ do
57+ context "with a large list" $ do
58+ it "succeeds" $ do
59+ let
60+ xs :: [Value]
61+ xs = replicate 5000 (Number 23)
62+ LB.writeFile "foo.yaml" (encode xs)
63+ decodeFile "foo.yaml" `shouldReturn` Just xs
64+
5565 describe "decodeFileEither" $ do
5666 context "when file does not exist" $ do
5767 it "returns Left (InvalidYaml (Just (YamlException \"Yaml file not found: ...\")))" $ do