mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 06:17:56 +08:00
make tests pass
This commit is contained in:
parent
bdaee9bcb2
commit
5ba2efc2b8
@ -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")
|
||||
|
||||
@ -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!")
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user