gilo/editor/Editor_test.go
Timothy Warren cc99f08747
Some checks failed
timw4mail/gilo/pipeline/head There was a failure building this commit
Update to chapter 7 step 161 in kilo tutorial
2023-10-03 17:02:22 -04:00

26 lines
425 B
Go

package editor
import "testing"
func TestNew(t *testing.T) {
e := NewEditor()
if e == nil {
t.Errorf("Failed to create editor")
}
}
func TestInsertChar(t *testing.T) {
e := NewEditor()
e.insertChar('q')
if e.doc.RowCount() != 1 {
t.Errorf("A row was not created when the character was inserted")
}
row := e.doc.GetRow(0)
if row.Size() != 1 {
t.Errorf("Failed to add character to row. Row: %v", row)
}
}