Add tests for baseFormatter
This commit is contained in:
parent
93f6e2d164
commit
1e67d08e49
22
format/formatter_test.go
Normal file
22
format/formatter_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package format // import "eriol.xyz/piken/format"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestBaseFormatterFields(t *testing.T) {
|
||||
bf := baseFormatter{}
|
||||
|
||||
fields := []string{"f1", "f2"}
|
||||
bf.SetFields(fields)
|
||||
assert.Equal(t, bf.Fields(), fields)
|
||||
}
|
||||
|
||||
func TestBaseFormatterShowGlyph(t *testing.T) {
|
||||
bf := baseFormatter{}
|
||||
|
||||
assert.Equal(t, bf.ShowGlyph(), false)
|
||||
bf.SetShowGlyph(true)
|
||||
assert.Equal(t, bf.ShowGlyph(), true)
|
||||
}
|
Loading…
Reference in a new issue