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
7d5c56b1
Commit
7d5c56b1
authored
Mar 28, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test duplicate CIDs in getMany
License: MIT Signed-off-by:
Steven Allen
<
steven@stebalien.com
>
parent
17f4c175
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
merkledag_test.go
merkledag_test.go
+30
-0
No files found.
merkledag_test.go
View file @
7d5c56b1
...
...
@@ -550,6 +550,36 @@ func TestCidRawDoesnNeedData(t *testing.T) {
}
}
func
TestGetManyDuplicate
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
srv
:=
NewDAGService
(
dstest
.
Bserv
())
nd
:=
NodeWithData
([]
byte
(
"foo"
))
if
err
:=
srv
.
Add
(
ctx
,
nd
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
nds
:=
srv
.
GetMany
(
ctx
,
[]
*
cid
.
Cid
{
nd
.
Cid
(),
nd
.
Cid
(),
nd
.
Cid
()})
out
,
ok
:=
<-
nds
if
!
ok
{
t
.
Fatal
(
"expecting node foo"
)
}
if
out
.
Err
!=
nil
{
t
.
Fatal
(
out
.
Err
)
}
if
!
out
.
Node
.
Cid
()
.
Equals
(
nd
.
Cid
())
{
t
.
Fatal
(
"got wrong node"
)
}
out
,
ok
=
<-
nds
if
ok
{
if
out
.
Err
!=
nil
{
t
.
Fatal
(
out
.
Err
)
}
else
{
t
.
Fatal
(
"expecting no more nodes"
)
}
}
}
func
TestEnumerateAsyncFailsNotFound
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
...
...
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