Skip to content

Commit

Permalink
test end to end
Browse files Browse the repository at this point in the history
  • Loading branch information
gabstv committed Feb 25, 2019
1 parent c2149a4 commit 9403658
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions n.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package bsdiff
25 changes: 25 additions & 0 deletions n_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package bsdiff

import (
"bytes"
"testing"

"github.com/gabstv/go-bsdiff/pkg/bsdiff"
"github.com/gabstv/go-bsdiff/pkg/bspatch"
)

func TestDiffPatch(t *testing.T) {
oldbs := []byte{0xFF, 0xFA, 0xB7, 0xDD}
newbs := []byte{0xFF, 0xFA, 0x90, 0xB7, 0xDD, 0xFE}
patch, err := bsdiff.Bytes(oldbs, newbs)
if err != nil {
t.Fatal(err.Error())
}
newbs2, err := bspatch.Bytes(oldbs, patch)
if err != nil {
t.Fatal(err.Error())
}
if !bytes.Equal(newbs, newbs2) {
t.Fatal(newbs2, "!=", newbs)
}
}

0 comments on commit 9403658

Please sign in to comment.