make tests pass

This commit is contained in:
Jeromy 2014-10-08 04:25:51 +00:00
parent bdaee9bcb2
commit 5ba2efc2b8
3 changed files with 7 additions and 9 deletions

View File

@ -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")

View File

@ -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!")

View File

@ -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)