MCPcopy Create free account
hub / github.com/diillson/chatcli / TestProcessorCreateSummaryView

Function TestProcessorCreateSummaryView

cli/ctxmgr/ctxmgr_test.go:1163–1187  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Processor: createSummaryView ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

1161// ---------------------------------------------------------------------------
1162
1163func TestProcessorCreateSummaryView(t *testing.T) {
1164 p := NewProcessor(zap.NewNop())
1165
1166 longContent := strings.Repeat("line\n", 100) // 100 lines
1167 files := []utils.FileInfo{
1168 {Path: "long.go", Content: longContent, Size: int64(len(longContent)), Type: "Go"},
1169 {Path: "short.go", Content: "short", Size: 5, Type: "Go"},
1170 }
1171
1172 summary := p.createSummaryView(files)
1173
1174 if len(summary) != 2 {
1175 t.Fatalf("expected 2 summary files, got %d", len(summary))
1176 }
1177
1178 // Long file should be truncated
1179 if !strings.Contains(summary[0].Content, "omitidas") {
1180 t.Error("expected long file to be truncated with omission notice")
1181 }
1182
1183 // Short file should remain unchanged
1184 if summary[1].Content != "short" {
1185 t.Errorf("expected short file to be unmodified, got %q", summary[1].Content)
1186 }
1187}

Callers

nothing calls this directly

Calls 4

createSummaryViewMethod · 0.95
ErrorfMethod · 0.80
NewProcessorFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected