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-merkledag
Commits
4726b1ee
Commit
4726b1ee
authored
Aug 07, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a stable-cid test
This test fails if the protobuf file is regenerated.
parent
682c569e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
node_test.go
node_test.go
+18
-0
No files found.
node_test.go
View file @
4726b1ee
...
...
@@ -9,8 +9,26 @@ import (
mdtest
"github.com/ipfs/go-merkledag/test"
ipld
"github.com/ipfs/go-ipld-format"
cid
"github.com/ipfs/go-cid"
)
func
TestStableCID
(
t
*
testing
.
T
)
{
nd
:=
&
ProtoNode
{}
nd
.
SetData
([]
byte
(
"foobar"
))
nd
.
SetLinks
([]
*
ipld
.
Link
{
{
Name
:
"a"
},
{
Name
:
"b"
},
{
Name
:
"c"
},
})
expected
,
err
:=
cid
.
Decode
(
"QmSN3WED2xPLbYvBbfvew2ZLtui8EbFYYcbfkpKH5jwG9C"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
!
nd
.
Cid
()
.
Equals
(
expected
)
{
t
.
Fatalf
(
"Got CID %s, expected CID %s"
,
nd
.
Cid
(),
expected
)
}
}
func
TestRemoveLink
(
t
*
testing
.
T
)
{
nd
:=
&
ProtoNode
{}
nd
.
SetLinks
([]
*
ipld
.
Link
{
...
...
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