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

Function TestDiffMapPathsSorted

internal/tool/diffmap_test.go:47–53  ·  view source on GitHub ↗

Paths are reported sorted so a message built from them is stable.

(t *testing.T)

Source from the content-addressed store, hash-verified

45
46// Paths are reported sorted so a message built from them is stable.
47func TestDiffMapPathsSorted(t *testing.T) {
48 dm := NewDiffMap(map[string]string{"c.go": "", "a.go": "", "b.go": ""})
49 got := strings.Join(dm.Paths(), ",")
50 if got != "a.go,b.go,c.go" {
51 t.Fatalf("Paths() = %q, want sorted", got)
52 }
53}
54
55// A path that holds an empty diff is still a path the message can offer.
56func TestDiffMapPathsKeepsEmptyDiff(t *testing.T) {

Callers

nothing calls this directly

Calls 2

PathsMethod · 0.95
NewDiffMapFunction · 0.85

Tested by

no test coverage detected