bytes compare
This commit is contained in:
parent
4c18e2a630
commit
8e21c716c7
|
@ -1,20 +1,21 @@
|
|||
package style
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"fmt"
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestColorBase_Regular(t *testing.T) {
|
||||
c := new(colorBase)
|
||||
strs := []string{"a", "b", "c"}
|
||||
input := make([]interface{}, len(strs))
|
||||
result := c.Bold(input)
|
||||
expected := fmt.Sprint(input)
|
||||
for i, s := range strs {
|
||||
input[i] = s
|
||||
}
|
||||
if result != expected{
|
||||
result := c.Regular(input)
|
||||
expected := fmt.Sprint(input)
|
||||
if !bytes.Equal([]byte(result), []byte(expected)){
|
||||
t.Error("Expected:", expected, "instead", result)
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +24,12 @@ func TestColorBase_Bold(t *testing.T) {
|
|||
c := new(colorBase)
|
||||
strs := []string{"a", "b", "c"}
|
||||
input := make([]interface{}, len(strs))
|
||||
result := c.Bold(input)
|
||||
expected := fmt.Sprint(input)
|
||||
for i, s := range strs {
|
||||
input[i] = s
|
||||
}
|
||||
if result != expected{
|
||||
result := c.Bold(input)
|
||||
expected := fmt.Sprint(input)
|
||||
if !bytes.Equal([]byte(result), []byte(expected)){
|
||||
t.Error("Expected:", expected, "instead", result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue