(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestNormalizeWhitespace_ManyLines(t *testing.T) { |
| 250 | // Test with many lines |
| 251 | lines := make([]string, 100) |
| 252 | for i := range 100 { |
| 253 | lines[i] = "line with trailing spaces " |
| 254 | } |
| 255 | var content strings.Builder |
| 256 | for _, line := range lines { |
| 257 | content.WriteString(line + "\n") |
| 258 | } |
| 259 | |
| 260 | result := NormalizeWhitespace(content.String()) |
| 261 | |
| 262 | // Check that all trailing spaces are removed |
| 263 | expectedLines := make([]string, 100) |
| 264 | for i := range 100 { |
| 265 | expectedLines[i] = "line with trailing spaces" |
| 266 | } |
| 267 | var expected strings.Builder |
| 268 | for _, line := range expectedLines { |
| 269 | expected.WriteString(line + "\n") |
| 270 | } |
| 271 | |
| 272 | assert.Equal(t, expected.String(), result, "NormalizeWhitespace should remove trailing spaces from all lines in large inputs") |
| 273 | } |
| 274 | |
| 275 | func TestNormalizeWhitespace_PreservesContent(t *testing.T) { |
| 276 | // Ensure that non-trailing whitespace is preserved |
nothing calls this directly
no test coverage detected