gilo/editor/editor_test.go
Timothy J. Warren e7ba61b2aa
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
Add more tests
2021-03-31 19:17:04 -04:00

35 lines
494 B
Go

package editor
import "testing"
func TestNew(t *testing.T) {
e := New()
if e == nil {
t.Errorf("Failed to create editor")
}
}
func TestAppendRow(t *testing.T) {
e := New()
e.appendRow("Test Row")
got := len(e.rows)
want := 1
if got != want {
t.Errorf("Failed to add a row to the editor")
}
}
func TestRowCount(t *testing.T) {
e := New()
e.appendRow("Test Row")
got := e.rowCount()
want := 1
if got != want {
t.Errorf("Expected %d rows, got %d rows", want, got)
}
}