test: add formatHTTPStatus tests
This commit is contained in:
19
internal/observability/status_test.go
Normal file
19
internal/observability/status_test.go
Normal 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")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user