From 9c19f0da1e0fdc6b6bfe312f86b397f2c69132c9 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 4 Jul 2026 05:17:30 +0200 Subject: [PATCH] test: add formatHTTPStatus tests --- internal/observability/status_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/observability/status_test.go diff --git a/internal/observability/status_test.go b/internal/observability/status_test.go new file mode 100644 index 00000000..0b38518a --- /dev/null +++ b/internal/observability/status_test.go @@ -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") + } +}