Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshsadiq committed Nov 23, 2021
1 parent 856c991 commit 734e37d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions godotenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ func TestActualEnvVarsAreLeftAlone(t *testing.T) {
}
}

// Issue https://github.com/joho/godotenv/issues/155
// Though the issue compares against ruby's dotenv. Because $1 (and others) is a special variable, it needs to be
// handled as such. Therefore, the result of the issue is as below.
func TestIssue155(t *testing.T) {
t.Parallel()
parseAndCompare(t, "VARIABLE_0=$a$0$12$_x", "VARIABLE_0", "2")
parseAndCompare(t, `VARIABLE_1="$a$0$12$_x"`, "VARIABLE_1", "2")
parseAndCompare(t, `VARIABLE_2='$a$0$12$_x'`, "VARIABLE_2", "$a$0$12$_x")
parseAndCompare(t, `VARIABLE_3= $a$0$12$_x`, "", "")
}

func TestParsing(t *testing.T) {
// unquoted values
parseAndCompare(t, "FOO=bar", "FOO", "bar")
Expand Down

0 comments on commit 734e37d

Please sign in to comment.