(t *testing.T)
| 287 | } |
| 288 | |
| 289 | func TestNormalizeLine(t *testing.T) { |
| 290 | tests := []struct { |
| 291 | input string |
| 292 | want string |
| 293 | }{ |
| 294 | {" hello ", "hello"}, |
| 295 | {"+added line", "added line"}, |
| 296 | {"-deleted line", "deleted line"}, |
| 297 | {"\tindented\t", "indented"}, |
| 298 | {"", ""}, |
| 299 | } |
| 300 | |
| 301 | for _, tt := range tests { |
| 302 | got := normalizeLine(tt.input) |
| 303 | if got != tt.want { |
| 304 | t.Errorf("normalizeLine(%q) = %q, want %q", tt.input, got, tt.want) |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | func TestSplitAndNormalize_SkipsEmptyLines(t *testing.T) { |
| 310 | lines := splitAndNormalize(`line1 |
nothing calls this directly
no test coverage detected