(t *testing.T)
| 285 | } |
| 286 | |
| 287 | func TestFormatSectionHeader(t *testing.T) { |
| 288 | tests := []struct { |
| 289 | name string |
| 290 | header string |
| 291 | expected string |
| 292 | }{ |
| 293 | { |
| 294 | name: "simple header", |
| 295 | header: "Overview", |
| 296 | expected: "Overview", |
| 297 | }, |
| 298 | { |
| 299 | name: "header with spaces", |
| 300 | header: "Key Findings", |
| 301 | expected: "Key Findings", |
| 302 | }, |
| 303 | { |
| 304 | name: "empty header", |
| 305 | header: "", |
| 306 | expected: "", |
| 307 | }, |
| 308 | { |
| 309 | name: "header with numbers", |
| 310 | header: "Section 1: Configuration", |
| 311 | expected: "Section 1: Configuration", |
| 312 | }, |
| 313 | } |
| 314 | |
| 315 | for _, tt := range tests { |
| 316 | t.Run(tt.name, func(t *testing.T) { |
| 317 | result := FormatSectionHeader(tt.header) |
| 318 | |
| 319 | // Should contain the header text |
| 320 | if !strings.Contains(result, tt.expected) { |
| 321 | t.Errorf("FormatSectionHeader() = %v, should contain %v", result, tt.expected) |
| 322 | } |
| 323 | |
| 324 | // Result should not be empty unless input was empty |
| 325 | if tt.header != "" && result == "" { |
| 326 | t.Errorf("FormatSectionHeader() returned empty string for non-empty input") |
| 327 | } |
| 328 | }) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | // Edge case tests for all formatting functions |
| 333 | func TestFormattingFunctionsWithSpecialCharacters(t *testing.T) { |
nothing calls this directly
no test coverage detected