From 0b90707e393d1c2d4470c3b60df4d1cf4beb424d Mon Sep 17 00:00:00 2001 From: Jeromy Date: Mon, 22 Aug 2016 20:40:17 -0700 Subject: [PATCH] update transport dep and add host test --- p2p/host/basic/basic_host_test.go | 28 ++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index e52222d..8ff677d 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -214,3 +214,31 @@ func TestHostProtoPreknowledge(t *testing.T) { s.Close() } + +func TestNewDialOld(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + h1, h2 := getHostPair(ctx, t) + defer h1.Close() + defer h2.Close() + + connectedOn := make(chan protocol.ID, 16) + h1.SetStreamHandler("/testing", func(s inet.Stream) { + connectedOn <- s.Protocol() + s.Close() + }) + + s, err := h2.NewStream(ctx, h1.ID(), "/testing/1.0.0", "/testing") + if err != nil { + t.Fatal(err) + } + + assertWait(t, connectedOn, "/testing") + + if s.Protocol() != "/testing" { + t.Fatal("shoould have gotten /testing") + } + + s.Close() +} diff --git a/package.json b/package.json index 75ee864..623b72a 100644 --- a/package.json +++ b/package.json @@ -159,9 +159,9 @@ }, { "author": "whyrusleeping", - "hash": "Qmep1A25MDNZxMno8oHZ5ForA5T2gw1EXAGdZzGCCpDD4n", + "hash": "QmbRuJ16EfPGWuEguoNxwPacpeHFUAZb2XQXVvUt5Vxg5q", "name": "go-libp2p-transport", - "version": "1.3.4" + "version": "1.3.5" }, { "author": "whyrusleeping", -- GitLab