forked from coop-cloud-mirrors/godotenv
Add a full fixture for comments for extra piece of mind
This commit is contained in:
4
fixtures/comments.env
Normal file
4
fixtures/comments.env
Normal file
@ -0,0 +1,4 @@
|
||||
# Full line comment
|
||||
foo=bar # baz
|
||||
bar=foo#baz
|
||||
baz="foo"#bar
|
@ -461,6 +461,17 @@ func TestErrorParsing(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestComments(t *testing.T) {
|
||||
envFileName := "fixtures/comments.env"
|
||||
expectedValues := map[string]string{
|
||||
"foo": "bar",
|
||||
"bar": "foo#baz",
|
||||
"baz": "foo",
|
||||
}
|
||||
|
||||
loadEnvAndCompareValues(t, Load, envFileName, expectedValues, noopPresets)
|
||||
}
|
||||
|
||||
func TestWrite(t *testing.T) {
|
||||
writeAndCompare := func(env string, expected string) {
|
||||
envMap, _ := Unmarshal(env)
|
||||
|
Reference in New Issue
Block a user