File: textarea_test.go

package info (click to toggle)
golang-github-gdamore-tcell.v2 2.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,064 kB
  • sloc: javascript: 219; sh: 16; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package views

import "testing"

func TestSetContent(t *testing.T) {
	ta := &TextArea{}

	ta.SetContent("This is a quite long line.")  // This line is longer than 11.
	ta.SetContent("Four.\nFive...\n...and Six.") //"...and Six." should be 11 long.

	if ta.model.height != 3 {
		t.Errorf("Incorrect height: %d, expected: %d", ta.model.height, 3)
	}
	if ta.model.width != 11 {
		t.Errorf("Incorrect width: %d, expected: %d", ta.model.width, 11)
	}
}