File: cursor_test.go

package info (click to toggle)
golang-github-atomicgo-cursor 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rw-r--r-- 446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cursor

import (
	"fmt"
	"testing"
)

func TestHeightChanges(t *testing.T) {
	for i := 0; i < 4; i++ {
		fmt.Println()
	}
	Up(3)

	if autoheight != 3 {
		t.Errorf("height should be 3 but is %d", autoheight)
	}

	Down(3)

	if autoheight != 0 {
		t.Errorf("height should be 0 but is %d", autoheight)
	}
}

func TestHeightCannotBeNegative(t *testing.T) {
	Down(10)

	if autoheight < 0 {
		t.Errorf("height is negative: %d", autoheight)
	}
}