From f0d823c2dbe8de23da3ad2e6594ae0b2b23fdc7b Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Thu, 30 Oct 2014 01:17:26 -0700 Subject: [PATCH] fix tests (circular import) --- core/core.go | 4 ++-- unixfs/io/dagwriter_test.go | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/core.go b/core/core.go index 5227237e2f1..543c71db036 100644 --- a/core/core.go +++ b/core/core.go @@ -161,8 +161,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (n *IpfsNode, err error) { if err != nil { n.Pinning = pin.NewPinner(n.Datastore, n.DAG) } - n.Resolver = &path.Resolver{DAG: n.DAG} - + n.Resolver = &path.Resolver{DAG: n.DAG} + success = true return n, nil } diff --git a/unixfs/io/dagwriter_test.go b/unixfs/io/dagwriter_test.go index 08779e2c1f2..edb4a0a70b2 100644 --- a/unixfs/io/dagwriter_test.go +++ b/unixfs/io/dagwriter_test.go @@ -1,4 +1,4 @@ -package io +package io_test import ( "testing" @@ -7,9 +7,10 @@ import ( ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" bs "github.com/jbenet/go-ipfs/blockservice" - "github.com/jbenet/go-ipfs/importer" + importer "github.com/jbenet/go-ipfs/importer" chunk "github.com/jbenet/go-ipfs/importer/chunk" mdag "github.com/jbenet/go-ipfs/merkledag" + dagio "github.com/jbenet/go-ipfs/unixfs/io" ) type datasource struct { @@ -55,7 +56,7 @@ func TestDagWriter(t *testing.T) { t.Fatal(err) } dag := mdag.NewDAGService(bserv) - dw := NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) + dw := dagio.NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) nbytes := int64(1024 * 1024 * 2) n, err := io.CopyN(dw, &datasource{}, nbytes) @@ -70,7 +71,7 @@ func TestDagWriter(t *testing.T) { dw.Close() node := dw.GetNode() - read, err := NewDagReader(node, dag) + read, err := dagio.NewDagReader(node, dag) if err != nil { t.Fatal(err) } @@ -89,7 +90,7 @@ func TestMassiveWrite(t *testing.T) { t.Fatal(err) } dag := mdag.NewDAGService(bserv) - dw := NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) + dw := dagio.NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) nbytes := int64(1024 * 1024 * 1024 * 16) n, err := io.CopyN(dw, &datasource{}, nbytes) @@ -114,7 +115,7 @@ func BenchmarkDagWriter(b *testing.B) { nbytes := int64(100000) for i := 0; i < b.N; i++ { b.SetBytes(nbytes) - dw := NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) + dw := dagio.NewDagWriter(dag, &chunk.SizeSplitter{Size: 4096}) n, err := io.CopyN(dw, &datasource{}, nbytes) if err != nil { b.Fatal(err) @@ -138,7 +139,7 @@ func TestAgainstImporter(t *testing.T) { nbytes := int64(1024 * 1024 * 2) // DagWriter - dw := NewDagWriter(dag, &chunk.SizeSplitter{4096}) + dw := dagio.NewDagWriter(dag, &chunk.SizeSplitter{4096}) n, err := io.CopyN(dw, &datasource{}, nbytes) if err != nil { t.Fatal(err)