tui/tests/screen_test.go

28 lines
407 B
Go
Raw Normal View History

2021-01-10 21:52:29 +01:00
package tui
import (
"errors"
"fmt"
"testing"
"tui"
"tui/views"
"github.com/gdamore/tcell"
)
func TestScreen(t *testing.T) {
eventView := views.NewEventView()
screen, err := tui.NewScreen(eventView)
if err != nil {
t.Error(err)
return
}
eventView.KeyPressed = func(key tcell.Key) {
screen.StopWithError(errors.New(fmt.Sprintf("%#v", key)))
}
err = screen.Start()
fmt.Println(err)
}