From 181d4286ad8dbca39bb4d43475b31ab9b3c626ee Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 30 Apr 2016 22:21:45 +0200 Subject: Support the new librsync (version 1.0.0) Compatibility with older versions is kept (tested 0.9.7). --- librsync/librsync_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'librsync/librsync_test.go') diff --git a/librsync/librsync_test.go b/librsync/librsync_test.go index 7c6a278..c291fac 100644 --- a/librsync/librsync_test.go +++ b/librsync/librsync_test.go @@ -22,7 +22,14 @@ func TestSignatureDeltaPatch(t *testing.T) { t.Fatalf("Creating the signature failed: %s", err) } - if !bytes.Equal(sigbuf.Bytes(), testdata.RandomDataSig()) { + matches := false + // Check both possible signatures. + for _, sigcheck := range testdata.RandomDataSig() { + if bytes.Equal(sigbuf.Bytes(), sigcheck) { + matches = true + } + } + if !matches { if path, err := dump(sigbuf); err == nil { t.Fatalf("Signatures do not match. Generated signature dumped to %s", path) } else { -- cgit v1.2.3-54-g00ecf