gilo/editor/document/document_test.go
Timothy Warren 469679cf6f
Some checks failed
timw4mail/gilo/pipeline/head There was a failure building this commit
Complete step 164 in Chapter 7 of Kilo tutorial
2023-10-04 10:37:47 -04:00

39 lines
577 B
Go

package document
import (
"testing"
"timshome.page/gilo/editor/highlight"
)
func TestNewDocument(t *testing.T) {
d := NewDocument()
if d == nil {
t.Errorf("Failed to create Document")
}
}
func TestAppendRow(t *testing.T) {
d := NewDocument()
d.AppendRow("Test Row")
got := len(d.rows)
want := 1
if got != want {
t.Errorf("Failed to add a row to the Document")
}
}
func TestRowCount(t *testing.T) {
d := NewDocument()
d.AppendRow("Test Row")
got := d.RowCount()
want := 1
if got != want {
t.Errorf("Expected %d rows, got %d rows", want, got)
}
}