1
0
Fork 0

Fix broken tests
timw4mail/gilo/pipeline/head This commit looks good Details

This commit is contained in:
Timothy Warren 2023-10-03 17:12:51 -04:00
parent cc99f08747
commit 3e8a08e454
1 changed files with 7 additions and 5 deletions

View File

@ -2,21 +2,23 @@ package document
import "testing"
var doc = NewDocument()
func TestNewRow(t *testing.T) {
str := "abcdefg"
row := newRow(str)
row := newRow(doc, str)
got := string(row.chars)
want := str
if got != want {
t.Errorf("Row chars not equal to original string. Row: %q, String: %q", row, str)
t.Errorf("Row chars not equal to original string. Row: %q, String: %q", row.chars, str)
}
}
func TestRowSize(t *testing.T) {
str := "abcdefg"
row := newRow(str)
row := newRow(doc, str)
got := row.Size()
want := 7
@ -28,7 +30,7 @@ func TestRowSize(t *testing.T) {
func TestRenderSize(t *testing.T) {
str := "\tabcdefg"
row := newRow(str)
row := newRow(doc, str)
row.update()
got := row.RenderSize()
@ -55,7 +57,7 @@ var insertRuneTests = []insertRune{
func TestInsertRune(t *testing.T) {
for _, test := range insertRuneTests {
row := newRow(test.initial)
row := newRow(doc, test.initial)
row.insertRune(test.ch, test.at)
if row.Size() != 5 {