mirror of
https://github.com/antonmedv/fx.git
synced 2024-09-11 18:27:10 +03:00
Fix tests
This commit is contained in:
parent
91cfbb11cc
commit
2c634b27d1
4
main.go
4
main.go
@ -129,7 +129,7 @@ func main() {
|
|||||||
fileName: fileName,
|
fileName: fileName,
|
||||||
digInput: digInput,
|
digInput: digInput,
|
||||||
searchInput: searchInput,
|
searchInput: searchInput,
|
||||||
search: NewSearch(),
|
search: newSearch(),
|
||||||
}
|
}
|
||||||
|
|
||||||
p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion())
|
p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion())
|
||||||
@ -714,7 +714,7 @@ func (m *model) dig(value string) *node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *model) doSearch(s string) {
|
func (m *model) doSearch(s string) {
|
||||||
m.search = NewSearch()
|
m.search = newSearch()
|
||||||
|
|
||||||
if s == "" {
|
if s == "" {
|
||||||
return
|
return
|
||||||
|
@ -29,9 +29,11 @@ func TestOutput(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
m := &model{
|
m := &model{
|
||||||
top: head,
|
top: head,
|
||||||
head: head,
|
head: head,
|
||||||
wrap: true,
|
wrap: true,
|
||||||
|
showCursor: true,
|
||||||
|
search: newSearch(),
|
||||||
}
|
}
|
||||||
tm := teatest.NewTestModel(
|
tm := teatest.NewTestModel(
|
||||||
t, m,
|
t, m,
|
||||||
|
@ -8,7 +8,7 @@ type search struct {
|
|||||||
keys map[*node][]match
|
keys map[*node][]match
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSearch() *search {
|
func newSearch() *search {
|
||||||
return &search{
|
return &search{
|
||||||
results: make([]*node, 0),
|
results: make([]*node, 0),
|
||||||
values: make(map[*node][]match),
|
values: make(map[*node][]match),
|
||||||
|
Loading…
Reference in New Issue
Block a user