-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmake_test.go
More file actions
43 lines (39 loc) · 1.04 KB
/
make_test.go
File metadata and controls
43 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// -----------------------------------------------------------------------------
// github.com/balacode/go-delta go-delta/[make_test.go]
// (c) balarabe@protonmail.com License: MIT
// -----------------------------------------------------------------------------
package delta
import (
"testing"
)
// go test --run Test_Make_
func Test_Make_(t *testing.T) {
if PrintTestNames {
printTestName()
}
// func Make(a, b []byte) Delta
//
test := func(a, b []byte, expect Delta) {
result := Make(a, b)
if result.GoString() != expect.GoString() {
t.Errorf("\n expect:\n\t%s\n result:\n\t%s\n",
expect.GoString(), result.GoString())
}
}
test(
ab(AtoZ),
ab(AtoZ),
Delta{
sourceSize: 26,
sourceHash: makeHash(ab(AtoZ)),
targetSize: 26,
targetHash: makeHash(ab(AtoZ)),
newCount: 0,
oldCount: 1,
parts: []deltaPart{
{sourceLoc: 0, size: 26, data: nil},
},
},
)
} // Test_Make_
// end