-
Notifications
You must be signed in to change notification settings - Fork 30
/
commp_test.go
42 lines (38 loc) · 13.4 KB
/
commp_test.go
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
package graphsplit
import (
"bytes"
"context"
"encoding/base64"
"io"
"io/ioutil"
"os"
"testing"
)
func TestCalcCommP(t *testing.T) {
logo := "OKJlcm9vdHOB2CpYIwASIGXF0MT5o2y08uzjZs3zUPTeSL1Vfny7WPy/PqKWVzshZ3ZlcnNpb24BUhIgZcXQxPmjbLTy7ONmzfNQ9N5IvVV+fLtY/L8+opZXOyESKgoiEiAwQIn2XJ17hEKaD4q2CSTpipS3R390WfxP/mjU/yswwRIBLhjTSQoCCAFeEiAwQIn2XJ17hEKaD4q2CSTpipS3R390WfxP/mjU/yswwRI2CiISIJd0bLclaExyM6dhdmj78a6JqZ4tATiXJNtmxveTVy+ZEg1maWxlZHJpdmUucG5nGJdJCgIIAblJEiCXdGy3JWhMcjOnYXZo+/GuiameLQE4lyTbZsb3k1cvmQqUSQgCEoxJiVBORw0KGgoAAAANSUhEUgAAANAAAADMCAMAAAA1bt2mAAABxVBMVEUAAAAOjv8bif8alP8hkP8hkv8hkf8hkv8hkf8ikf8hkP8hkf8hkP8hjv8hkf8ikf4fj/8hkf8hkf8hkP8hkf8hk/8hkf8hkf8hkP8kj/8hkv8hkf8hkf8hkf8hkf8hkf8hkP8hkf8hkf8hkf8ikf8hkf8hkP8fkv8hkP8hkf8hkf8gkP8hkf8hkf4ikf8hkP8hj/8hkf8hkP8hkf8ikP8hkv8hkf8hj/0hj/4gj/7///8hkf8hkv8djv4cjf4hk/8fjv78/v8bjP4ilf/5/P8pk/76/f/3+//y8vIjkP7+/v/x+P8lkf4Yi/71+v+73f/z+f/L5f+Oxv4xl/7v9/9utv4ulv4mkv7k8f+Av/5Fov7h8P/e7v/G4v5BoP632/+fz//D4P5TqP7b7f/T6f+s1f6Hw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bDpfnbYG0ajZBag1R1G9dbqa3988XvxPqfwZR51247xSqdzdVSrn541256jsHvYbNMZ4e46wP3cAAAAASUVORK5CYIIYjEk="
logob, err := base64.StdEncoding.DecodeString(logo)
if err != nil {
t.Fatalf("base64 decode error: %v", err)
}
tempDir := os.TempDir()
f, err := ioutil.TempFile(tempDir, "test_car")
if err != nil {
t.Fatalf("create tempfile error: %v", err)
}
defer f.Close()
tempfile := f.Name()
_, err = io.Copy(f, bytes.NewReader(logob))
if err != nil {
t.Fatal(err)
}
res, err := CalcCommP(context.TODO(), tempfile, false, false)
if err != nil {
t.Fatal(err)
}
if res.Root.String() != "baga6ea4seaqjri25o5pmj2aa7mrwd2kpadzr66ee7roj32savs5jvvunbdjboli" {
t.Fatal("Unexpected piece CID")
}
if res.Size != 16256 {
t.Fatal("Unexpected piece size")
}
}