mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-13 03:59:23 +02:00
Ported tests all pass
This commit is contained in:
@@ -11,6 +11,7 @@ package rsync
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
@@ -314,9 +315,9 @@ func (r *rsync) ApplyDelta(alignedTarget io.Writer, target io.ReadSeeker, op Ope
|
||||
return err
|
||||
}
|
||||
case OpHash:
|
||||
expected := r.checksummer.Sum(nil)
|
||||
if !bytes.Equal(expected, op.Data) {
|
||||
return fmt.Errorf("Failed to verify overall file checksum. This usually happens if some data was corrupted in transit or one of the involved files was altered while the transfer was in progress.")
|
||||
actual := r.checksummer.Sum(nil)
|
||||
if !bytes.Equal(actual, op.Data) {
|
||||
return fmt.Errorf("Failed to verify overall file checksum actual: %s != expected: %s. This usually happens if some data was corrupted in transit or one of the involved files was altered while the transfer was in progress.", hex.EncodeToString(actual), hex.EncodeToString(op.Data))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -85,7 +85,7 @@ func run_roundtrip_test(t *testing.T, src_data, changed []byte, num_of_patches,
|
||||
|
||||
// Now try with serialization
|
||||
using_serialization = true
|
||||
p = NewPatcher(int64(len(src_data)))
|
||||
p = NewPatcher(int64(len(changed)))
|
||||
signature_of_changed := bytes.Buffer{}
|
||||
ss_it := p.CreateSignatureIterator(bytes.NewReader(changed), &signature_of_changed)
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user