From 0f5223410ec274feade57f19afd6ac37d5ee495a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Guzm=C3=A1n?= Date: Mon, 10 Jun 2024 22:11:21 -0500 Subject: [PATCH] test: Enhance test cases for more robust `\n` --- spec/Configuration/Dotenv/TextSpec.hs | 4 ++-- spec/fixtures/.dotenv | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/Configuration/Dotenv/TextSpec.hs b/spec/Configuration/Dotenv/TextSpec.hs index b2e886c..ac50334 100644 --- a/spec/Configuration/Dotenv/TextSpec.hs +++ b/spec/Configuration/Dotenv/TextSpec.hs @@ -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") diff --git a/spec/fixtures/.dotenv b/spec/fixtures/.dotenv index b04e046..eeeb3d6 100644 --- a/spec/fixtures/.dotenv +++ b/spec/fixtures/.dotenv @@ -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 +"