MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestNormalizeLine

Function TestNormalizeLine

internal/diff/resolver_test.go:289–307  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

287}
288
289func 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
309func TestSplitAndNormalize_SkipsEmptyLines(t *testing.T) {
310 lines := splitAndNormalize(`line1

Callers

nothing calls this directly

Calls 1

normalizeLineFunction · 0.70

Tested by

no test coverage detected