tui/tests/screen_test.go
2021-01-10 21:52:29 +01:00

28 lines
407 B
Go

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)
}