mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-05 15:06:50 +08:00
Feature/cover unit test (#81)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package byteUtil
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBytesToStr(t *testing.T) {
|
||||
tests := []struct {
|
||||
@@ -14,9 +17,7 @@ func TestBytesToStr(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := BytesToStr(tt.data)
|
||||
if got != tt.expected {
|
||||
t.Errorf("BytesToStr(%v) = %v, want %v", tt.data, got, tt.expected)
|
||||
}
|
||||
assert.Equal(t, tt.expected, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user