From 0e56345653a1a1b3019c624fca7121c8cf5687da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Guzm=C3=A1n?= Date: Mon, 10 Jun 2024 21:45:46 -0500 Subject: [PATCH] fix: Correctly parse newline and multiline strings in dotenv files --- spec/Configuration/Dotenv/TextSpec.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/Configuration/Dotenv/TextSpec.hs b/spec/Configuration/Dotenv/TextSpec.hs index 373b2709..b2e886ce 100644 --- a/spec/Configuration/Dotenv/TextSpec.hs +++ b/spec/Configuration/Dotenv/TextSpec.hs @@ -27,3 +27,11 @@ spec = it "recognizes unicode characters" $ liftM (!! 1) (parseFile "spec/fixtures/.dotenv") `shouldReturn` (T.pack "UNICODE_TEST", T.pack "ManabĂ­") + + it "handles newline characters correctly" $ do + liftM (!! 6) (parseFile "spec/fixtures/.dotenv") `shouldReturn` + (T.pack "NEWLINE_TEST", T.pack "Hello\nWorld") + + it "handles manual line breaks correctly" $ do + liftM (!! 7) (parseFile "spec/fixtures/.dotenv") `shouldReturn` + (T.pack "MULTILINE_TEST", T.pack "Roses are red\nViolets are blue\nCode is my art\nAnd bugs are my glue")