MCPcopy
hub / github.com/peco/peco / TestTopDownQueryBottomLayout

Function TestTopDownQueryBottomLayout

layout_test.go:399–420  ·  view source on GitHub ↗

TestTopDownQueryBottomLayout verifies the specific properties of the top-down-query-bottom layout.

(t *testing.T)

Source from the content-addressed store, hash-verified

397// TestTopDownQueryBottomLayout verifies the specific properties of the
398// top-down-query-bottom layout.
399func TestTopDownQueryBottomLayout(t *testing.T) {
400 state := New()
401 state.screen = NewDummyScreen()
402
403 state.Filters().Add(filter.NewIgnoreCase())
404
405 layout, err := TopDownQueryBottomLayout(state)
406 require.NoError(t, err)
407
408 require.Equal(t, AnchorBottom, layout.prompt.anchor,
409 "prompt should be anchored at bottom")
410 require.Equal(t, 1+extraOffset, layout.prompt.anchorOffset,
411 "prompt anchor offset should be 1+extraOffset")
412 require.Equal(t, AnchorTop, layout.list.anchor,
413 "list should be anchored at top")
414 require.Equal(t, 0, layout.list.anchorOffset,
415 "list anchor offset should be 0")
416 require.True(t, layout.list.sortTopDown,
417 "list should sort top-down")
418 require.True(t, layout.SortTopDown(),
419 "SortTopDown() should return true")
420}
421
422// TestCursorStyle verifies that UserPrompt.cursorStyle returns the correct
423// fg/bg attributes depending on QueryCursor and Query style configuration.

Callers

nothing calls this directly

Calls 7

NewIgnoreCaseFunction · 0.92
NewDummyScreenFunction · 0.85
TopDownQueryBottomLayoutFunction · 0.85
FiltersMethod · 0.80
NewFunction · 0.70
AddMethod · 0.65
SortTopDownMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…