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)
| 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. |
| 339 | func 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. |
nothing calls this directly
no test coverage detected