@cryptotaxi247 / kubo / commits / 5ba2efc2b

make tests pass

Jeromy committed Oct 8, 2014 at 04:25 UTC 5ba2efc2b83e55cb12bb82919d75e78f0ef7a064
3 files changed +7 -9
blockservice/blocks_test.go
+1 -6
@@ -17,12 +17,7 @@ func TestBlocks(t *testing.T) {
17 return
18 }
19
20 - b, err := blocks.NewBlock([]byte("beep boop"))
21 - if err != nil {
22 - t.Error("failed to construct block", err)
23 - return
24 - }
25 -
20 + b := blocks.NewBlock([]byte("beep boop"))
21 h := u.Hash([]byte("beep boop"))
22 if !bytes.Equal(b.Multihash, h) {
23 t.Error("Block Multihash and data multihash not equal")
blockstore/blockstore_test.go
+3 -3
@@ -24,9 +24,9 @@ func TestGetWhenKeyNotPresent(t *testing.T) {
24
25 func TestPutThenGetBlock(t *testing.T) {
26 bs := NewBlockstore(ds.NewMapDatastore())
27 - block := blocks.NewBlock("some data")
27 + block := blocks.NewBlock([]byte("some data"))
28
29 - err := bs.Put(block)
29 + err := bs.Put(*block)
30 if err != nil {
31 t.Fatal(err)
32 }
@@ -41,7 +41,7 @@ func TestPutThenGetBlock(t *testing.T) {
41 }
42
43 func TestValueTypeMismatch(t *testing.T) {
44 - block := blocks.NewBlock("some data")
44 + block := blocks.NewBlock([]byte("some data"))
45
46 datastore := ds.NewMapDatastore()
47 datastore.Put(block.Key().DsKey(), "data that isn't a block!")
cmd/ipfs/mount_unix.go
+3
@@ -78,6 +78,9 @@ func mountIpfs(node *core.IpfsNode, fsdir string) <-chan error {
78 }
79
80 func mountIpns(node *core.IpfsNode, nsdir, fsdir string) <-chan error {
81 + if nsdir == "" {
82 + return nil
83 + }
84 done := make(chan error)
85 fmt.Printf("mounting ipns at %s\n", nsdir)
86