MCPcopy Create free account
hub / github.com/github/gh-aw / TestFormatCountChange

Function TestFormatCountChange

pkg/cli/audit_diff_test.go:686–706  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

684}
685
686func TestFormatCountChange(t *testing.T) {
687 tests := []struct {
688 name string
689 count1 int
690 count2 int
691 expected string
692 }{
693 {name: "increase", count1: 3, count2: 8, expected: "+5"},
694 {name: "decrease", count1: 10, count2: 3, expected: "-7"},
695 {name: "no change", count1: 5, count2: 5, expected: "+0"},
696 {name: "from zero", count1: 0, count2: 4, expected: "+4"},
697 {name: "to zero", count1: 6, count2: 0, expected: "-6"},
698 }
699
700 for _, tt := range tests {
701 t.Run(tt.name, func(t *testing.T) {
702 result := formatCountChange(tt.count1, tt.count2)
703 assert.Equal(t, tt.expected, result, "Count change format should match")
704 })
705 }
706}
707
708func TestIsEmptyMCPToolsDiff(t *testing.T) {
709 assert.True(t, isEmptyMCPToolsDiff(&MCPToolsDiff{}), "Empty MCPToolsDiff should be detected")

Callers

nothing calls this directly

Calls 2

formatCountChangeFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected