1 package views 2 3 import "testing" 4 5 func TestText(t *testing.T) { 6 text := &Text{} 7 8 text.SetText(` 9 This 10 String 11 Is 12 Pretty 13 Long 14 12345678901234567890 15 `) 16 if text.width != 20 { 17 t.Errorf("Incorrect width: %d, expected: %d", text.width, 20) 18 } 19 } 20