Commit c1662615 authored by Karthic Rao's avatar Karthic Rao

more test cases for the test struct

parent 84998a4d
...@@ -63,6 +63,41 @@ func TestLogParse(t *testing.T) { ...@@ -63,6 +63,41 @@ func TestLogParse(t *testing.T) {
OutputFile: "log.txt", OutputFile: "log.txt",
Format: caddylog.DefaultLogFormat, Format: caddylog.DefaultLogFormat,
}}}, }}},
{`log /serve stdout`, false, []caddylog.Rule{{
PathScope: "/serve",
OutputFile: "stdout",
Format: caddylog.DefaultLogFormat,
}}},
{`log /myapi log.txt {common}`, false, []caddylog.Rule{{
PathScope: "/myapi",
OutputFile: "log.txt",
Format: caddylog.CommonLogFormat,
}}},
{`log /test accesslog.txt {combined}`, false, []caddylog.Rule{{
PathScope: "/test",
OutputFile: "accesslog.txt",
Format: caddylog.CombinedLogFormat,
}}},
{`log /api1 log.txt
log /api2 accesslog.txt {combined}`, false, []caddylog.Rule{{
PathScope: "/api1",
OutputFile: "log.txt",
Format: caddylog.DefaultLogFormat,
}, {
PathScope: "/api2",
OutputFile: "accesslog.txt",
Format: caddylog.CombinedLogFormat,
}}},
{`log /api3 stdout {host}
log /api4 log.txt {when}`, false, []caddylog.Rule{{
PathScope: "/api3",
OutputFile: "stdout",
Format: "{host}",
}, {
PathScope: "/api4",
OutputFile: "log.txt",
Format: "{when}",
}}},
} }
for i, test := range tests { for i, test := range tests {
c := newTestController(test.inputLogRules) c := newTestController(test.inputLogRules)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment