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.Row(0) if row.Size() != 1 { t.Errorf("Failed to add character to row. Row: %v", row) } }