From 77e8b7d7d658fee2a9ddb99b7b6c91e90e37b24e Mon Sep 17 00:00:00 2001 From: John Barton Date: Fri, 24 Sep 2021 20:33:25 +1000 Subject: [PATCH] Expand fixture tests to include multiline strings --- fixtures/quoted.env | 10 ++++++++++ godotenv_test.go | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/fixtures/quoted.env b/fixtures/quoted.env index cc6376a..7958933 100644 --- a/fixtures/quoted.env +++ b/fixtures/quoted.env @@ -7,3 +7,13 @@ OPTION_F="2" OPTION_G="" OPTION_H="\n" OPTION_I = "echo 'asd'" +OPTION_J='line 1 +line 2' +OPTION_K='line one +this is \'quoted\' +one more line' +OPTION_L="line 1 +line 2" +OPTION_M="line one +this is \"quoted\" +one more line" diff --git a/godotenv_test.go b/godotenv_test.go index 0045a8c..f5820b6 100644 --- a/godotenv_test.go +++ b/godotenv_test.go @@ -189,6 +189,10 @@ func TestLoadQuotedEnv(t *testing.T) { "OPTION_G": "", "OPTION_H": "\n", "OPTION_I": "echo 'asd'", + "OPTION_J": "line 1\nline 2", + "OPTION_K": "line one\nthis is \\'quoted\\'\none more line", + "OPTION_L": "line 1\nline 2", + "OPTION_M": "line one\nthis is \"quoted\"\none more line", } loadEnvAndCompareValues(t, Load, envFileName, expectedValues, noopPresets)