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

Function TestLogViewer_Clear

internal/tui/log_test.go:131–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

129}
130
131func TestLogViewer_Clear(t *testing.T) {
132 lv := NewLogViewer()
133 lv.entries = []LogEntry{{Text: "test"}}
134 lv.scrollPos = 5
135 lv.autoScroll = false
136
137 lv.Clear()
138
139 if len(lv.entries) != 0 {
140 t.Error("Expected entries to be empty after Clear")
141 }
142 if lv.scrollPos != 0 {
143 t.Error("Expected scrollPos to be 0 after Clear")
144 }
145 if !lv.autoScroll {
146 t.Error("Expected autoScroll to be true after Clear")
147 }
148}
149
150func TestLogViewer_SetSize(t *testing.T) {
151 lv := NewLogViewer()

Callers

nothing calls this directly

Calls 2

ClearMethod · 0.95
NewLogViewerFunction · 0.85

Tested by

no test coverage detected