test: add formatHTTPStatus tests

This commit is contained in:
2026-07-04 05:17:30 +02:00
parent d1eafdd6de
commit 9c19f0da1e

View File

@@ -0,0 +1,19 @@
package observability
import (
"testing"
)
func TestFormatHTTPStatusReturnsPlainWhenNoColor(t *testing.T) {
colorLogs = false
if got := formatHTTPStatus(200); got != "200" {
t.Fatalf("got %q, want %q", got, "200")
}
}
func TestFormatHTTPStatusReturnsFallback(t *testing.T) {
colorLogs = false
if got := formatHTTPStatus("ok"); got != "ok" {
t.Fatalf("got %q, want %q", got, "ok")
}
}