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
adf62a39
Commit
adf62a39
authored
10 years ago
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refac(bitswap:notif) replace block generating func
parent
ad14d6c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
bitswap/notifications/notifications_test.go
bitswap/notifications/notifications_test.go
+3
-10
No files found.
bitswap/notifications/notifications_test.go
View file @
adf62a39
...
...
@@ -6,12 +6,13 @@ import (
"time"
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
testutil
"github.com/jbenet/go-ipfs/util/testutil"
blocks
"github.com/jbenet/go-ipfs/blocks"
)
func
TestPublishSubscribe
(
t
*
testing
.
T
)
{
blockSent
:=
get
BlockOrFail
(
t
,
"Greetings from The Interval"
)
blockSent
:=
testutil
.
New
BlockOrFail
(
t
,
"Greetings from The Interval"
)
n
:=
New
()
defer
n
.
Shutdown
()
...
...
@@ -34,7 +35,7 @@ func TestCarryOnWhenDeadlineExpires(t *testing.T) {
n
:=
New
()
defer
n
.
Shutdown
()
block
:=
get
BlockOrFail
(
t
,
"A Missed Connection"
)
block
:=
testutil
.
New
BlockOrFail
(
t
,
"A Missed Connection"
)
blockChannel
:=
n
.
Subscribe
(
fastExpiringCtx
,
block
.
Key
())
assertBlockChannelNil
(
t
,
blockChannel
)
...
...
@@ -55,11 +56,3 @@ func assertBlocksEqual(t *testing.T, a, b blocks.Block) {
t
.
Fail
()
}
}
func
getBlockOrFail
(
t
*
testing
.
T
,
msg
string
)
blocks
.
Block
{
block
,
blockCreationErr
:=
blocks
.
NewBlock
([]
byte
(
msg
))
if
blockCreationErr
!=
nil
{
t
.
Fail
()
}
return
*
block
}
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