Skip to content

Commit

Permalink
test: Enhance test cases for more robust \n
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzGB committed Jun 11, 2024
1 parent 0e56345 commit 0f52234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/Configuration/Dotenv/TextSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ spec =

it "handles newline characters correctly" $ do
liftM (!! 6) (parseFile "spec/fixtures/.dotenv") `shouldReturn`
(T.pack "NEWLINE_TEST", T.pack "Hello\nWorld")
(T.pack "NEWLINE_TEST", T.pack "Hello\nWorld\nThis is a test\n")

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")
(T.pack "MULTILINE_TEST", T.pack "Roses are red\nViolets are blue\nCode is my art\nAnd bugs are my glue\n")
5 changes: 3 additions & 2 deletions spec/fixtures/.dotenv
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ ENVIRONMENT="$HOME"
PREVIOUS="$DOTENV"
ME="$(whoami)"
BLANK=
NEWLINE_TEST="Hello\nWorld"
NEWLINE_TEST="Hello\nWorld\nThis is a test\n"
MULTILINE_TEST="Roses are red
Violets are blue
Code is my art
And bugs are my glue"
And bugs are my glue
"

0 comments on commit 0f52234

Please sign in to comment.