2017-08-11 19:03:58 +00:00
|
|
|
package style
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2017-08-12 22:53:17 +00:00
|
|
|
"bytes"
|
|
|
|
"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)
|
|
|
|
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)
|
|
|
|
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
|
|
|
}
|