(t *testing.T, entry *AccessEntry, additional map[string]any, expectedOutput string, o Options, )
| 71 | } |
| 72 | |
| 73 | func testAccessLogExtended(t *testing.T, entry *AccessEntry, |
| 74 | additional map[string]any, |
| 75 | expectedOutput string, |
| 76 | o Options, |
| 77 | ) { |
| 78 | var buf bytes.Buffer |
| 79 | o.AccessLogOutput = &buf |
| 80 | lg := NewAccessLogger(o) |
| 81 | lg.LogAccess(entry, additional) |
| 82 | got := buf.String() |
| 83 | if got != "" { |
| 84 | got = got[:len(got)-1] |
| 85 | } |
| 86 | |
| 87 | if got != expectedOutput { |
| 88 | t.Error("got wrong access log.") |
| 89 | t.Log("got :", got) |
| 90 | t.Log("expected:", expectedOutput) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | func testAccessLogDefault(t *testing.T, entry *AccessEntry, expectedOutput string) { |
| 95 | testAccessLog(t, entry, expectedOutput, Options{}) |
no test coverage detected
searching dependent graphs…