2017-08-11 19:03:58 +00:00
|
|
|
package style
|
|
|
|
|
|
|
|
import (
|
2017-08-12 22:53:17 +00:00
|
|
|
"bytes"
|
2017-08-14 23:13:30 +00:00
|
|
|
"fmt"
|
2017-08-12 22:53:17 +00:00
|
|
|
"testing"
|
2017-08-11 19:03:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestColorBase_Regular(t *testing.T) {
|
|
|
|
c := new(colorBase)
|
|
|
|
strs := []string{"a", "b", "c"}
|
|
|
|
input := make([]interface{}, len(strs))
|
|
|
|
for i, s := range strs {
|
|
|
|
input[i] = s
|
|
|
|
}
|
2017-08-12 22:53:17 +00:00
|
|
|
result := c.Regular(input)
|
|
|
|
expected := fmt.Sprint(input)
|
2017-08-14 23:13:30 +00:00
|
|
|
if !bytes.Equal([]byte(result), []byte(expected)) {
|
2017-08-11 19:03:58 +00:00
|
|
|
t.Error("Expected:", expected, "instead", result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestColorBase_Bold(t *testing.T) {
|
|
|
|
c := new(colorBase)
|
|
|
|
strs := []string{"a", "b", "c"}
|
|
|
|
input := make([]interface{}, len(strs))
|
|
|
|
for i, s := range strs {
|
|
|
|
input[i] = s
|
|
|
|
}
|
2017-08-12 22:53:17 +00:00
|
|
|
result := c.Bold(input)
|
|
|
|
expected := fmt.Sprint(input)
|
2017-08-14 23:13:30 +00:00
|
|
|
if !bytes.Equal([]byte(result), []byte(expected)) {
|
2017-08-11 19:03:58 +00:00
|
|
|
t.Error("Expected:", expected, "instead", result)
|
|
|
|
}
|
2017-08-12 22:53:17 +00:00
|
|
|
}
|