File: box_test.go

package info (click to toggle)
golang-github-buger-goterm 0.0%2Bgit20181115.c206103-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124 kB
  • sloc: makefile: 3
file content (24 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package goterm

import (
	"fmt"
	"testing"
)

func TestBox(t *testing.T) {
	boxSample := `
┌--------┐
│ hello  │
│ world  │
│ test   │
└--------┘`

	box := NewBox(10, 5, 0)
	fmt.Fprint(box, "hello\nworld\ntest")

	if box.String() != boxSample[1:] {
		t.Error("\n" + box.String())
		t.Error("!=")
		t.Error(boxSample)
	}
}