2015-12-12 04:24:49 +01:00
|
|
|
// Copyright © 2015 Daniele Tricoli <eriol@mornie.org>.
|
|
|
|
// All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-12-11 03:43:06 +01:00
|
|
|
package format // import "eriol.xyz/piken/format"
|
2015-12-12 04:24:49 +01:00
|
|
|
|
2015-12-11 03:43:06 +01:00
|
|
|
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)
|
|
|
|
}
|