(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func 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 | } |