gilo/editor/row_test.go
Timothy Warren ae65be003c
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
Fix some offset errors for cursor operations
2021-03-31 14:32:43 -04:00

28 lines
450 B
Go

package editor
import "testing"
func TestNewRow(t *testing.T) {
str := "abcdefg"
row := newRow(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)
}
}
func TestRowSize(t *testing.T) {
str := "abcdefg"
row := newRow(str)
got := row.size()
want := 7
if got != want {
t.Errorf("Row size not equal to number of runes in original string")
}
}