MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestSlashClearResetsHistory

Function TestSlashClearResetsHistory

internal/tui/tui_test.go:841–851  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

839}
840
841func TestSlashClearResetsHistory(t *testing.T) {
842 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
843 m.history = append(m.history,
844 chmctx.Message{Role: chmctx.RoleUser, Content: "hi"},
845 chmctx.Message{Role: chmctx.RoleAssistant, Content: "hey"},
846 )
847 m2, _ := m.runSlash("/clear")
848 if len(m2.(Model).history) != 0 {
849 t.Fatal("/clear must drop history")
850 }
851}
852
853// TestSlashClearWipesTerminalScrollback: tea.ClearScreen (\x1b[2J) clears only
854// the visible region; the saved-lines buffer needs the DECSED 3 sequence from

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
runSlashMethod · 0.80

Tested by

no test coverage detected