diff options
author | Ayke van Laethem <aykevanlaethem@gmail.com> | 2016-04-30 22:21:45 +0200 |
---|---|---|
committer | Ayke van Laethem <aykevanlaethem@gmail.com> | 2016-04-30 22:22:44 +0200 |
commit | 181d4286ad8dbca39bb4d43475b31ab9b3c626ee (patch) | |
tree | f38824251e6eb4ff64919ea89bcb1729ed49656f /librsync/librsync_test.go | |
parent | 4ce8be3db5b6afe8e984367c2aad1f21bed9d47d (diff) | |
download | golibrsync-181d4286ad8dbca39bb4d43475b31ab9b3c626ee.tar.gz golibrsync-181d4286ad8dbca39bb4d43475b31ab9b3c626ee.tar.bz2 golibrsync-181d4286ad8dbca39bb4d43475b31ab9b3c626ee.zip |
Support the new librsync (version 1.0.0)
Compatibility with older versions is kept (tested 0.9.7).
Diffstat (limited to 'librsync/librsync_test.go')
-rw-r--r-- | librsync/librsync_test.go | 9 |
1 files changed, 8 insertions, 1 deletions
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 { |