(t *testing.T)
| 211 | } |
| 212 | |
| 213 | func TestNormalizeWhitespace_OnlyWhitespace(t *testing.T) { |
| 214 | tests := []struct { |
| 215 | name string |
| 216 | content string |
| 217 | expected string |
| 218 | }{ |
| 219 | { |
| 220 | name: "only spaces", |
| 221 | content: " ", |
| 222 | expected: "", // After trimming trailing spaces and newlines, becomes empty |
| 223 | }, |
| 224 | { |
| 225 | name: "only tabs", |
| 226 | content: "\t\t\t", |
| 227 | expected: "", // After trimming trailing tabs and newlines, becomes empty |
| 228 | }, |
| 229 | { |
| 230 | name: "mixed spaces and tabs", |
| 231 | content: " \t \t", |
| 232 | expected: "", // After trimming, becomes empty |
| 233 | }, |
| 234 | { |
| 235 | name: "only newlines", |
| 236 | content: "\n\n\n", |
| 237 | expected: "", |
| 238 | }, |
| 239 | } |
| 240 | |
| 241 | for _, tt := range tests { |
| 242 | t.Run(tt.name, func(t *testing.T) { |
| 243 | result := NormalizeWhitespace(tt.content) |
| 244 | assert.Equal(t, tt.expected, result, "NormalizeWhitespace(%q) should handle whitespace-only input", tt.content) |
| 245 | }) |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | func TestNormalizeWhitespace_ManyLines(t *testing.T) { |
| 250 | // Test with many lines |
nothing calls this directly
no test coverage detected