MCPcopy
hub / github.com/peco/peco / newTestInlineScreen

Function newTestInlineScreen

screen_inline_test.go:15–27  ·  view source on GitHub ↗

newTestInlineScreen creates an InlineScreen backed by a SimulationScreen for testing coordinate translation and size behavior.

(termWidth, termHeight, inlineHeight int)

Source from the content-addressed store, hash-verified

13// newTestInlineScreen creates an InlineScreen backed by a SimulationScreen
14// for testing coordinate translation and size behavior.
15func newTestInlineScreen(termWidth, termHeight, inlineHeight int) (*InlineScreen, tcell.SimulationScreen) {
16 sim := tcell.NewSimulationScreen("")
17 sim.Init()
18 sim.SetSize(termWidth, termHeight)
19
20 s := &InlineScreen{
21 heightSpec: config.HeightSpec{Value: inlineHeight, IsPercent: false},
22 screen: sim,
23 height: inlineHeight,
24 yOffset: termHeight - inlineHeight,
25 }
26 return s, sim
27}
28
29func TestInlineScreenSize(t *testing.T) {
30 s, _ := newTestInlineScreen(80, 24, 10)

Callers 3

TestInlineScreenSizeFunction · 0.85
TestInlineScreenSetCellFunction · 0.85

Calls 1

InitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…