MCPcopy
hub / github.com/cortesi/devd / TestNil

Function TestNil

inject/inject_test.go:104–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestNil(t *testing.T) {
105 ci := CopyInject{}
106 val := "onetwothree"
107 src := bytes.NewBuffer([]byte(val))
108 injector, err := ci.Sniff(src, "")
109 if injector.Found() || err != nil {
110 t.Error("Unexpected")
111 }
112 dst := bytes.NewBuffer(make([]byte, 0))
113 injector.Copy(dst)
114 if string(dst.Bytes()) != val {
115 t.Errorf("Expected %s, got %s", val, string(dst.Bytes()))
116 }
117}

Callers

nothing calls this directly

Calls 3

SniffMethod · 0.95
FoundMethod · 0.65
CopyMethod · 0.65

Tested by

no test coverage detected