TestPopoverTabCompletesUniquePrefix: with one match, Tab completes the name and, because /models takes args, appends a space that flips the popover into arg-level mode. Flow: "/mod " → "/models " + arg popover.
(t *testing.T)
| 326 | // and, because /models takes args, appends a space that flips the popover into |
| 327 | // arg-level mode. Flow: "/mod<Tab>" → "/models " + arg popover. |
| 328 | func TestPopoverTabCompletesUniquePrefix(t *testing.T) { |
| 329 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 330 | mm := typeInto(m, "/mod") // only /models matches |
| 331 | if len(mm.suggest) != 1 { |
| 332 | t.Fatalf("precondition: one match for /mod, got %d", len(mm.suggest)) |
| 333 | } |
| 334 | mm2, _ := mm.Update(tea.KeyMsg{Type: tea.KeyTab}) |
| 335 | om := mm2.(Model) |
| 336 | if got := om.ta.Value(); got != "/models " { |
| 337 | t.Fatalf("Tab should complete to '/models ' (with trailing space), got %q", got) |
| 338 | } |
| 339 | if !om.suggestArgLevel || om.activeCmd != "/models" { |
| 340 | t.Fatalf("popover should have transitioned to arg-level for /models: "+ |
| 341 | "level=%v cmd=%q", om.suggestArgLevel, om.activeCmd) |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | // TestPopoverTabOnClearCommandHasNoArgSpace: /clear takes no args, so Tab |
| 346 | // completes to "/clear" WITHOUT a trailing space. |
nothing calls this directly
no test coverage detected