Skip to content

Commit

Permalink
created test to verify ip tag size.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulaguila committed Aug 30, 2023
1 parent e25825f commit 1ffd7f6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions middleware/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,25 @@ func getLatencyTimeUnits() []struct {
}
}

// go test -run Test_Logger_LenTagIP
func Test_Logger_LenTagIP(t *testing.T) {
t.Parallel()
buf := bytebufferpool.Get()
defer bytebufferpool.Put(buf)

app := fiber.New()
app.Use(New(Config{
Format: "${ip}",
Output: buf,
}))

resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", nil))
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, fiber.StatusNotFound, resp.StatusCode)

utils.AssertEqual(t, 15, len(buf.String()))
}

// go test -run Test_Logger_WithLatency
func Test_Logger_WithLatency(t *testing.T) {
t.Parallel()
Expand Down

0 comments on commit 1ffd7f6

Please sign in to comment.