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