package internal import ( "os" "path/filepath" "strings" "testing" "time" ) // TestHtmlStatusBadge tests the htmlStatusBadge function. func TestHtmlStatusBadge(t *testing.T) { tests := []struct { status nagiosCode expected string }{ {nagiosOk, `OK`}, {nagiosWarning, `WARNING`}, {nagiosCritical, `CRITICAL`}, {nagiosUnknown, `UNKNOWN`}, } for _, tt := range tests { result := htmlStatusBadge(tt.status) if result != tt.expected { t.Errorf("htmlStatusBadge(%v) = %q, want %q", tt.status, result, tt.expected) } } } // TestHtmlHeader tests the htmlHeader function. func TestHtmlHeader(t *testing.T) { subject := "GOGIOS Report [C:1 W:2 U:3 S:4 SU:6 OK:5]" result := htmlHeader(subject, 1, 2, 3, 4, 6, 5) // Check that the header contains expected elements expectedElements := []string{ "", ``, "", ``, `", subject, ``, "