From c3e69073e52d15358a556c39cae2380cd12bee67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 2 Aug 2018 18:06:54 +0200 Subject: [PATCH] block cmd: go-path update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- core/coreapi/block_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/coreapi/block_test.go b/core/coreapi/block_test.go index 7026a1681..fcd32cb25 100644 --- a/core/coreapi/block_test.go +++ b/core/coreapi/block_test.go @@ -6,6 +6,7 @@ import ( "strings" "testing" + coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash" @@ -87,6 +88,19 @@ func TestBlockGet(t *testing.T) { if string(d) != "Hello" { t.Error("didn't get correct data back") } + + p, err := coreiface.ParsePath("/ipfs/" + res.Path().Cid().String()) + if err != nil { + t.Error(err) + } + + rp, err := api.ResolvePath(ctx, p) + if err != nil { + t.Fatal(err) + } + if rp.Cid().String() != res.Path().Cid().String() { + t.Error("paths didn't match") + } } func TestBlockRm(t *testing.T) {