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

Function TestSetValueClearsChips

internal/tui/prompt_test.go:339–349  ·  view source on GitHub ↗

TestSetValueClearsChips: SetValue installs plain text and drops prior chips, used by slash-popover Tab-completion, where chips can't be part of a replacement.

(t *testing.T)

Source from the content-addressed store, hash-verified

337// TestSetValueClearsChips: SetValue installs plain text and drops prior chips,
338// used by slash-popover Tab-completion, where chips can't be part of a replacement.
339func TestSetValueClearsChips(t *testing.T) {
340 p := newChippablePrompt()
341 p, _ = p.Update(pasteKey(makePaste(10)))
342 p.SetValue("/models work")
343 if p.DisplayValue() != "/models work" {
344 t.Fatalf("SetValue should install text verbatim, got %q", p.DisplayValue())
345 }
346 if len(p.spans) != 0 {
347 t.Fatal("SetValue should drop any existing chips")
348 }
349}
350
351// TestBackspaceNotAtChipBoundaryFallsThrough: Backspace away from a chip boundary
352// deletes one char normally, chip untouched.

Callers

nothing calls this directly

Calls 6

newChippablePromptFunction · 0.85
pasteKeyFunction · 0.85
makePasteFunction · 0.85
SetValueMethod · 0.80
DisplayValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected