diff --git a/opts/envfile_test.go b/opts/envfile_test.go index dd79f60925..bda9dcb6e7 100644 --- a/opts/envfile_test.go +++ b/opts/envfile_test.go @@ -162,3 +162,17 @@ HOME t.Fatal("exactly one variable is imported (as the other one is not set at all)") } } + +// ParseEnvFile with empty variable name +func TestParseEnvVariableWithNoNameFile(t *testing.T) { + content := `# comment= +=blank variable names are an error case +` + tmpFile := tmpFileWithContent(content, t) + defer os.Remove(tmpFile) + + _, err := ParseEnvFile(tmpFile) + if nil == err { + t.Fatal("if a variable has no name parsing an environment file must fail") + } +}