diff --git a/caddy/parse/parsing_test.go b/caddy/parse/parsing_test.go index cdb6ae08..8533b2a3 100644 --- a/caddy/parse/parsing_test.go +++ b/caddy/parse/parsing_test.go @@ -335,10 +335,10 @@ func TestParseAll(t *testing.T) { }}, {`import import_glob*.txt`, false, [][]address{ - []address{{"glob0.host0", ""}}, - []address{{"glob0.host1", ""}}, - []address{{"glob1.host0", ""}}, - []address{{"glob2.host0", ""}}, + []address{{"glob0.host0", "", "glob0.host0", ""}}, + []address{{"glob0.host1", "", "glob0.host1", ""}}, + []address{{"glob1.host0", "", "glob1.host0", ""}}, + []address{{"glob2.host0", "", "glob2.host0", ""}}, }}, } { p := testParser(test.input) @@ -450,6 +450,13 @@ func TestEnvironmentReplacement(t *testing.T) { if actual, expected := blocks[0].Addresses[0].Port, ""; expected != actual { t.Errorf("Expected port to be '%s' but was '%s'", expected, actual) } + + // in quoted field + p = testParser(":1234\ndir1 \"Test {$FOOBAR} test\"") + blocks, _ = p.parseAll() + if actual, expected := blocks[0].Tokens["dir1"][1].text, "Test foobar test"; expected != actual { + t.Errorf("Expected argument to be '%s' but was '%s'", expected, actual) + } } func setupParseTests() {