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

Function TestEmptyRunesKeyIsDropped

internal/tui/tui_test.go:2876–2884  ·  view source on GitHub ↗

TestEmptyRunesKeyIsDropped: KeyMsg{Type: KeyRunes, Runes: nil} arises when bubbletea's parser chokes on a partial escape sequence. Falling through inserts nothing but triggers recomputeLayout: a stream of them flickers the UI, so drop them at the front door.

(t *testing.T)

Source from the content-addressed store, hash-verified

2874 out2, _ := om.update(tea.WindowSizeMsg{Width: 80, Height: 24})
2875 om2 := out2.(Model)
2876 if joined2 := strings.Join(om2.outbox, "\n"); strings.Contains(joined2, "hamr time") {
2877 t.Fatalf("splash must be a one-shot, got re-emit: %s", joined2)
2878 }
2879}
2880
2881// TestStreamingShownInLiveView: the streaming buffer is rendered above
2882// the prompt by View() while content is in flight, so the user sees
2883// tokens immediately even before the block flushes to scrollback.
2884func TestStreamingShownInLiveView(t *testing.T) {
2885 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2886 m.streaming.WriteString("live tokens arriving...")
2887 if !strings.Contains(stripANSI(m.View()), "live tokens arriving") {

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
ValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected