Skip to content

Commit

Permalink
fix: Correctly parse newline and multiline strings in dotenv files
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzGB committed Jun 11, 2024
1 parent a8b8d4f commit 0e56345
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/Configuration/Dotenv/TextSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 0e56345

Please sign in to comment.