MCPcopy
hub / github.com/moncho/dry / TestLessModel_SearchMode

Function TestLessModel_SearchMode

appui/overlay_test.go:117–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestLessModel_SearchMode(t *testing.T) {
118 m := NewLessModel()
119 m.SetSize(80, 24)
120 m.SetContent("hello world\nfoo bar\nhello again", "Test")
121
122 // Enter search mode
123 m, _ = m.Update(tea.KeyPressMsg{Code: '/'})
124 if m.mode != lessSearching {
125 t.Fatalf("expected lessSearching, got %d", m.mode)
126 }
127
128 // Escape cancels search
129 m, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyEscape})
130 if m.mode != lessNormal {
131 t.Fatalf("expected lessNormal after esc, got %d", m.mode)
132 }
133}
134
135func TestLessModel_FilterMode(t *testing.T) {
136 m := NewLessModel()

Callers

nothing calls this directly

Calls 4

SetSizeMethod · 0.95
SetContentMethod · 0.95
UpdateMethod · 0.95
NewLessModelFunction · 0.85

Tested by

no test coverage detected