gilo/editor/editor_test.go
Timothy Warren 38d127e419
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
Split input handling from editor.go
2021-04-02 12:03:33 -04:00

26 lines
421 B
Go

package editor
import "testing"
func TestNew(t *testing.T) {
e := New()
if e == nil {
t.Errorf("Failed to create editor")
}
}
func TestInsertChar(t *testing.T) {
e := New()
e.insertChar('q')
if e.document.rowCount() != 1 {
t.Errorf("A row was not created when the character was inserted")
}
row := e.document.rows[0]
if row.size() != 1 {
t.Errorf("Failed to add character to row. Row: %v", row)
}
}