From 5ba2efc2b83e55cb12bb82919d75e78f0ef7a064 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 8 Oct 2014 04:25:51 +0000 Subject: [PATCH] make tests pass --- blockservice/blocks_test.go | 7 +------ blockstore/blockstore_test.go | 6 +++--- cmd/ipfs/mount_unix.go | 3 +++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/blockservice/blocks_test.go b/blockservice/blocks_test.go index bfffc37b8..764d2d400 100644 --- a/blockservice/blocks_test.go +++ b/blockservice/blocks_test.go @@ -17,12 +17,7 @@ func TestBlocks(t *testing.T) { return } - b, err := blocks.NewBlock([]byte("beep boop")) - if err != nil { - t.Error("failed to construct block", err) - return - } - + b := blocks.NewBlock([]byte("beep boop")) h := u.Hash([]byte("beep boop")) if !bytes.Equal(b.Multihash, h) { t.Error("Block Multihash and data multihash not equal") diff --git a/blockstore/blockstore_test.go b/blockstore/blockstore_test.go index e64424c49..c9e7275b1 100644 --- a/blockstore/blockstore_test.go +++ b/blockstore/blockstore_test.go @@ -24,9 +24,9 @@ func TestGetWhenKeyNotPresent(t *testing.T) { func TestPutThenGetBlock(t *testing.T) { bs := NewBlockstore(ds.NewMapDatastore()) - block := blocks.NewBlock("some data") + block := blocks.NewBlock([]byte("some data")) - err := bs.Put(block) + err := bs.Put(*block) if err != nil { t.Fatal(err) } @@ -41,7 +41,7 @@ func TestPutThenGetBlock(t *testing.T) { } func TestValueTypeMismatch(t *testing.T) { - block := blocks.NewBlock("some data") + block := blocks.NewBlock([]byte("some data")) datastore := ds.NewMapDatastore() datastore.Put(block.Key().DsKey(), "data that isn't a block!") diff --git a/cmd/ipfs/mount_unix.go b/cmd/ipfs/mount_unix.go index 1b4e8709a..84fbc9cf6 100644 --- a/cmd/ipfs/mount_unix.go +++ b/cmd/ipfs/mount_unix.go @@ -78,6 +78,9 @@ func mountIpfs(node *core.IpfsNode, fsdir string) <-chan error { } func mountIpns(node *core.IpfsNode, nsdir, fsdir string) <-chan error { + if nsdir == "" { + return nil + } done := make(chan error) fmt.Printf("mounting ipns at %s\n", nsdir)