MCPcopy Create free account
hub / github.com/digitalocean/go-libvirt / TestEncode

Function TestEncode

rpc_test.go:212–228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

210 ok = IsNotFound(err)
211 if !ok {
212 t.Errorf("expected true, got %t", ok)
213 }
214}
215
216func TestEncode(t *testing.T) {
217 data := "test"
218 buf, err := encode(data)
219 if err != nil {
220 t.Error(err)
221 }
222
223 dec := xdr.NewDecoder(bytes.NewReader(buf))
224 res, _, err := dec.DecodeString()
225 if err != nil {
226 t.Error(err)
227 }
228
229 if res != data {
230 t.Errorf("expected %s, got %s", data, res)
231 }

Callers

nothing calls this directly

Calls 3

DecodeStringMethod · 0.95
encodeFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…