MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestAddEvent_NoCacheWhenWidthZero

Function TestAddEvent_NoCacheWhenWidthZero

internal/tui/log_perf_test.go:49–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestAddEvent_NoCacheWhenWidthZero(t *testing.T) {
50 lv := NewLogViewer()
51 // Width is 0 (default)
52
53 lv.AddEvent(makeTextEvent("Hello world"))
54
55 if len(lv.entries) != 1 {
56 t.Fatalf("Expected 1 entry, got %d", len(lv.entries))
57 }
58 if len(lv.entries[0].cachedLines) != 0 {
59 t.Error("Expected cachedLines to be empty when width is 0")
60 }
61 if lv.totalLineCount != 0 {
62 t.Errorf("Expected totalLineCount 0, got %d", lv.totalLineCount)
63 }
64}
65
66func TestAddEvent_FiltersUnwantedEvents(t *testing.T) {
67 lv := NewLogViewer()

Callers

nothing calls this directly

Calls 3

AddEventMethod · 0.95
NewLogViewerFunction · 0.85
makeTextEventFunction · 0.85

Tested by

no test coverage detected