mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 12:57:44 +08:00
gofmt
This commit is contained in:
parent
5eed33620f
commit
1d3e72a33b
@ -1,28 +1,28 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
mh "github.com/jbenet/go-multihash"
|
||||
"testing"
|
||||
"bytes"
|
||||
"fmt"
|
||||
mh "github.com/jbenet/go-multihash"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestKey(t *testing.T) {
|
||||
|
||||
h1, err := mh.Sum([]byte("beep boop"), mh.SHA2_256, -1)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
h1, err := mh.Sum([]byte("beep boop"), mh.SHA2_256, -1)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
k1 := Key(h1)
|
||||
h2 := mh.Multihash(k1)
|
||||
k2 := Key(h2)
|
||||
k1 := Key(h1)
|
||||
h2 := mh.Multihash(k1)
|
||||
k2 := Key(h2)
|
||||
|
||||
if !bytes.Equal(h1, h2) {
|
||||
t.Error("Multihashes not equal.")
|
||||
}
|
||||
if !bytes.Equal(h1, h2) {
|
||||
t.Error("Multihashes not equal.")
|
||||
}
|
||||
|
||||
if k1 != k2 {
|
||||
t.Error("Keys not equal.")
|
||||
}
|
||||
if k1 != k2 {
|
||||
t.Error("Keys not equal.")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user