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

Function TestNormalizeLine

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

Source from the content-addressed store, hash-verified

284}
285
286func 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
306func TestSplitAndNormalize_SkipsEmptyLines(t *testing.T) {
307 lines := splitAndNormalize(`line1

Callers

nothing calls this directly

Calls 1

normalizeLineFunction · 0.70

Tested by

no test coverage detected