func TestPatch(t *testing.T) {
	r := require.New(t)
	a := assert.New(t)
	for _, tt := range allTestCases {
		t.Run(tt, func(t *testing.T) {
			file, _, _, _, err := argsFromTestName(tt)
			r.NoError(err)
			baseFile, err := os.Open("testdata/" + file + ".old")
			r.NoError(err)
			deltaFile, err := os.Open("testdata/" + tt + ".delta")
			r.NoError(err)
			output := &bytes.Buffer{}
			err = Patch(baseFile, deltaFile, output)
			r.NoError(err)
			wantNewFile, err := ioutil.ReadFile("testdata/" + file + ".new")
			r.NoError(err)
			gotNewFile, err := ioutil.ReadAll(output)
			r.NoError(err)
			a.Equal(wantNewFile, gotNewFile)
		})
	}
}
TestPatch tests patching only, using a reference delta.
package librsync
import (
	"bytes"
	"io/ioutil"
	"os"
	"testing"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)