File: text_element_test.go

package info (click to toggle)
golang-github-yosssi-gohtml 0.0~git20180130.97fbf36-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 140 kB
  • sloc: makefile: 2
file content (17 lines) | stat: -rw-r--r-- 334 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package gohtml

import (
	"bytes"
	"testing"
)

func TestTextElementWrite(t *testing.T) {
	textElem := &textElement{text: "Test text"}
	bf := &bytes.Buffer{}
	textElem.write(bf, 0)
	actual := bf.String()
	expected := "Test text"
	if actual != expected {
		t.Errorf("Invalid result. [expected: %s][actual: %s]", expected, actual)
	}
}