Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
1d3e72a3
Commit
1d3e72a3
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt
parent
5eed3362
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
util/util_test.go
util/util_test.go
+17
-17
No files found.
util/util_test.go
View file @
1d3e72a3
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."
)
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment