--------------------------------------------------------------------------- Processor: createSummaryView ---------------------------------------------------------------------------
(t *testing.T)
| 1161 | // --------------------------------------------------------------------------- |
| 1162 | |
| 1163 | func 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 | } |
nothing calls this directly
no test coverage detected