MCPcopy
hub / github.com/gin-gonic/gin / TestBytesToString

Function TestBytesToString

internal/bytesconv/bytesconv_test.go:31–42  ·  view source on GitHub ↗

go test -v

(t *testing.T)

Source from the content-addressed store, hash-verified

29// go test -v
30
31func TestBytesToString(t *testing.T) {
32 data := make([]byte, 1024)
33 for range 100 {
34 _, err := cRand.Read(data)
35 if err != nil {
36 t.Fatal(err)
37 }
38 if rawBytesToStr(data) != BytesToString(data) {
39 t.Fatal("don't match")
40 }
41 }
42}
43
44func TestBytesToStringEmpty(t *testing.T) {
45 if got := BytesToString([]byte{}); got != "" {

Callers

nothing calls this directly

Calls 3

rawBytesToStrFunction · 0.85
BytesToStringFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected