MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestPopoverTabOnClearCommandHasNoArgSpace

Function TestPopoverTabOnClearCommandHasNoArgSpace

internal/tui/tui_test.go:347–357  ·  view source on GitHub ↗

TestPopoverTabOnClearCommandHasNoArgSpace: /clear takes no args, so Tab completes to "/clear" WITHOUT a trailing space.

(t *testing.T)

Source from the content-addressed store, hash-verified

345// TestPopoverTabOnClearCommandHasNoArgSpace: /clear takes no args, so Tab
346// completes to "/clear" WITHOUT a trailing space.
347func TestPopoverTabOnClearCommandHasNoArgSpace(t *testing.T) {
348 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
349 mm := typeInto(m, "/cl") // only /clear matches
350 if len(mm.suggest) != 1 {
351 t.Fatalf("precondition: one match for /cl, got %d", len(mm.suggest))
352 }
353 mm2, _ := mm.Update(tea.KeyMsg{Type: tea.KeyTab})
354 if got := mm2.(Model).ta.Value(); got != "/clear" {
355 t.Fatalf("Tab should complete to '/clear' (no trailing space for no-arg cmds), got %q", got)
356 }
357}
358
359// TestPopoverShiftTabCyclesUp: Shift+Tab walks the selection backwards,
360// wrapping at the top.

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
typeIntoFunction · 0.85
ValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected