33 lines
541 B
Go
33 lines
541 B
Go
package editor
|
|
|
|
import "testing"
|
|
|
|
func TestNew(t *testing.T) {
|
|
e := New()
|
|
|
|
if e == nil {
|
|
t.Errorf("Failed to create editor")
|
|
}
|
|
}
|
|
|
|
//type moveCursor struct {
|
|
// key string
|
|
// editor *editor
|
|
//}
|
|
//
|
|
//var cursorTests = []moveCursor{
|
|
// {"\x1b", New()},
|
|
//}
|
|
//
|
|
//func TestMoveCursor(t *testing.T) {
|
|
// for _, test := range cursorTests {
|
|
// e := New()
|
|
// e.moveCursor(test.key)
|
|
// want := test.editor
|
|
// got := e
|
|
//
|
|
// if got != want {
|
|
// t.Errorf("Output %v not equal to expected %v for input %q", got, want, test.key)
|
|
// }
|
|
// }
|
|
//}
|